Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue22212

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:zipfile.py fails if zlib.so module fails to build.
Type:behaviorStage:resolved
Components:BuildVersions:Python 3.5
process
Status:closedResolution:duplicate
Dependencies:Superseder: Shared modules built with Modules/Setup are not found when run from build directory
View:17095
Assigned To:Nosy List: Alex.LordThorsen, John.Malmberg, ezio.melotti, ned.deily
Priority:normalKeywords:

Created on2014-08-16 21:29 byJohn.Malmberg, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Messages (3)
msg225417 -(view)Author: John Malmberg (John.Malmberg)*Date: 2014-08-16 21:29
If the zlib.so fails to build while building python, subsequent runs of setup.py fail, which prevents a trying again to build zlib.so after the issue is fixed unless all the .so modules built are deleted.   File "/PRJ_ROOT/CPYTHON/Lib/zipfile.py", line 20, in <module>     crc32 = zlib.crc32AttributeError: module 'zlib' has no attribute 'crc32'make: *** [sharedmods] Error 1zipfile.py is trying to test for a missing zlib.so by checking if the import fails.The problem is that while the zlib module did not get built, the import of it succeeds because the directory is now in the module path at thispoint in the build.Using -v on Python shows the import succeeding.Python 3.5.0a0 (default, Aug 13 2014, 19:13:13) [C] on openvms0Type "help", "copyright", "credits" or "license" for more information. >>> import zlib# possible namespace for /PRJ_ROOT/CPYTHON/Modules/zlibimport 'zlib' # None.In order to get setup.py to work in this case, the following patch isneeded for zipfile.py--- /src_root/cpython/Lib/zipfile.py    Mon Jun 16 18:00:20 2014+++ /vms_root/cpython/Lib/zipfile.py    Thu Aug 14 20:39:47 2014@@ -18,7 +18,7 @@  try:      import zlib # We may need its compression method      crc32 = zlib.crc32-except ImportError:+except (ImportError, AttributeError):      zlib = None      crc32 = binascii.crc32This is not a complete solution for zlib.so module not building.  The run_tests.py also fails when zlib.so is not present.Setup.py reports that zlib.so is an optional module, so not being build should not cause the setup.py to fail.
msg226544 -(view)Author: Alex LordThorsen (Alex.LordThorsen)*Date: 2014-09-07 21:03
Just adding that I have also run into this problem.
msg226550 -(view)Author: Ned Deily (ned.deily)*(Python committer)Date: 2014-09-08 00:28
This problem has been introduced by the initial changes forIssue17095.  That issue has been re-opened and the resolution will be covered there.
History
DateUserActionArgs
2022-04-11 14:58:07adminsetgithub: 66408
2014-09-08 00:28:28ned.deilysetstatus: open -> closed

superseder:Shared modules built with Modules/Setup are not found when run from build directory

nosy: +ned.deily
messages: +msg226550
resolution: duplicate
stage: needs patch -> resolved
2014-09-07 21:03:01Alex.LordThorsensetnosy: +Alex.LordThorsen
messages: +msg226544
2014-08-17 18:15:50ezio.melottisetnosy: +ezio.melotti

type: behavior
stage: needs patch
2014-08-16 21:29:12John.Malmbergcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp