Closed vikramsubramanian closed 2 months ago
Hey thanks for the report.
Tests are working fine on my Arch installation.
I'm thinking to either timing issue or missing [xattr
]( support for settings the file creation time.
Is the error systematic or sporadic?
Do you have the possibility to replace time.sleep(0.5)
with time.sleep(2)
and see if it improves things?
Can you run the following and share the output please:
import inspect
import tempfile
import os
from loguru._ctime_functions import set_ctime, get_ctime
print("== set_ctime ==")
print(inspect.getsource(set_ctime))
print("== get_ctime ==")
print(inspect.getsource(get_ctime))
with tempfile.TemporaryDirectory(dir=".") as tmp_dir:
filepath = os.path.join(tmp_dir, "foo.txt")
with open(filepath, "w") as file:
pass
print("== ctime ==")
set_ctime(filepath, 123.456)
res = get_ctime(filepath)
print(res)
print("== xattr ==")
os.setxattr(filepath, b"user.loguru_test", b"test")
res = os.getxattr(filepath, b"user.loguru_test")
print(res)
I refactored the test a little bit. I increased the sleep times and also added a check to skip the test if the platform does not seem to support getting/setting file creation time.
If you're still experiencing the issue, please re-open this ticket so we can investigate it further. :+1:
Hi! I'm currently working on packaging 0.6.0 for Arch Linux. In the packaging environment we usually run the test suite of upstream projects to have easy integration testing upon upgrades.
Unfortunately the mentioned test fails and I'm not sure why:
Maybe you have a clue? :)
This is with