-
-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standalone: Resource files obtained by importlib.resources.files(...).iterdir()
cannot be sorted
#2400
Comments
I see, comparison is also something I have not seen before, but sorting is of course a thing bound to be desired. |
I managed to reproduce this, should be easy to add, however, not sure what the best way is. Probably converting itself and argument to |
Thanks, that was super easy to use. The only way it could have been better would be to provide project options with Thanks for your report, this is fixed on the factory branch, which is a development version under rapid development. You can try it out by going here: https://nuitka.net/doc/factory.html Feedback if this is working is very welcome, just please do not share plans of doing it, but rather confirmations or denials of it working. |
It works now. Thank you! |
Explanation: Richard works in the same project as I do. He verified this factory-version fix of the issue, and the issue is gone now. |
No worries, I do not actually manage to track who said what anyway. If you have more like these, swing them my way. Nuitka is supposed to be compatible, but for all I know, there is no ultimate API description that I can test against, so this is continously catching up to what Python does and thus people expect to happen. Very happy with these reports. |
This was released with 1.8 and should definitely be in 1.9, this was forgotten to be updated. |
Problem description:
Another PyPI package, Pyphen, assumes that objects returned from
importlib.resources.files(...).iterdir()
can be compared using the<
operator, since it callssorted()
on the.iterdir()
result, but theimportlib.resources.abc.Traversable
Protocol does not guarantee that objects returend by.iterdir()
can be compared using the<
operator. See also Kozea/Pyphen#54 for more info. Perhaps of an unfortunate misunderstanding the issue on Pyphen is already closed, while I still think that one should not rely on functionality that appears to be working but is not backed by documentation describing that it should.Nonetheless the Nuitka developer/maintainer asked me to create an issue on Nuitka, since he wants to stay as compatible as possible with plain Python functionality.
So here we go:
Versions
Installation info
Virtual environment
Created with
Activated with
Installed packages
Source files
See attached
.zip
file → implib_sorted_resources_problem.zipOutput using plain Python
Nuitka build command
Actual output using Nuitka-built version
Additional info:
The text was updated successfully, but these errors were encountered: