Closed zx80 closed 3 months ago
I'm a lost at the renaming, couldn't you have keep it with the same previous name, ie
crypt
?
Hello @zx80. I'm sorry if the renaming is confusing. I certainly hope it isn't harmful.
I had hoped that installing passlib 1.7.4 + _cryptr with Python 3.13 would work out of the box.
However passlib (which does not seem to be updated soon) does
from crypt import crypt ...
, so a key point is that the package name (not its publication name, I'm fine withcrypt_r
) must be crypt and the provided function must be crypt for this to work.
And that should work. The README says:
To use this module, you can either import
crypt_r
explicitly or use the oldcrypt
name for backward compatibility. However, on Python older than 3.13, thecrypt
module from the standard library will usually take precedence onsys.path
.
And it works for me:
$ python3.13 -m pip install crypt_r
$ python
Python 3.13.0rc1 (main, Aug 6 2024, 00:00:00) [GCC 13.3.1 20240522 (Red Hat 13.3.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from crypt import crypt
>>> crypt.__module__
'crypt_r'
This is even tested in our test suite.
There should not be any issue with Python 3.13 because there is no
crypt
, it was removed, that's the point.
Exactly.
There should not be any issue with prior versions because there is a
crypt
there and it is the same as this one, so declaring a dependency conditional on the version would be enough. The new crypt_r module should declare that it requires Python 3.13 or above.
The way I did it is that you can use import crypt_r
even on older Python to avoid the deprecation warning.
But you can keep doing import crypt
if you don't mind that it will get you the old crypt
on old Pythons and this crypt_r
on new Pythons.
What am I missing?
Probably that it actually works?
What am I missing?
Probably that it actually works?
Ok, good news! Thanks!!
Thanks for the reply.
I'm a lost at the renaming, couldn't you have keep it with the same previous name, ie
crypt
?I had hoped that installing passlib 1.7.4 + _cryptr with Python 3.13 would work out of the box.
However passlib (which does not seem to be updated soon) does
from crypt import crypt ...
, so a key point is that the package name (not its publication name, I'm fine withcrypt_r
) must be crypt and the provided function must be crypt for this to work.There should not be any issue with Python 3.13 because there is no
crypt
, it was removed, that's the point.There should not be any issue with prior versions because there is a
crypt
there and it is the same as this one, so declaring a dependency conditional on the version would be enough. The new crypt_r module should declare that it requires Python 3.13 or above.What am I missing?