pyz-dispenser / cpython-static

Static builds of CPython
1 stars 0 forks source link

Remove PEP 594-related modules ("dead batteries") #1

Closed duckinator closed 4 years ago

duckinator commented 4 years ago

PEP 594 ("Removing dead batteries from the standard library") recommends removing a certain collection of modules. Any of those which were in Setup.local are removed by this commit.

https://www.python.org/dev/peps/pep-0594/

Removed modules:

The rest were not referenced in Setup.local, and thus are left alone.

Note, however, that removing _crypt but not crypt means you can still import crypt and get an ImportError:

/home/puppy/dev/python/pyz-dispenser/x # PYTHONPATH=./stdlib.zip ./python
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python 3.8.0 (tags/v3.8.0:fa919fd, Feb  7 2020, 02:19:56) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import crypt
Traceback (most recent call last):
  File "/home/puppy/dev/python/pyz-dispenser/x/stdlib.zip/crypt.py", line 6, in <module>
ModuleNotFoundError: No module named '_crypt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/home/puppy/dev/python/pyz-dispenser/x/stdlib.zip/crypt.py", line 11, in <module>
ImportError: The required _crypt module was not built as part of CPython
>>> 
AstraLuma commented 4 years ago

That file is generated by gen-setup.py.

Please update that file and follow the directions at the end of the readme.

AstraLuma commented 4 years ago

Also, if you want to add a blacklist feature to build-std.py, i would be for it.

duckinator commented 4 years ago

I'm not sure why it included changes to things I didn't touch, but... it does. I can revert those if you'd like.

AstraLuma commented 4 years ago

oh! probably because I updated debian and python without regenerating it?

But only patch updates, so idk.

That's what setup.py claims those modules need, though.