This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: py3k build fails if configure --without-threads
Type: Stage:
Components: Build Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, ocean-city
Priority: normal Keywords: patch

Created on 2008-09-09 06:56 by ocean-city, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
py3k_remove_itertools_from_traceback.patch ocean-city, 2008-09-09 13:38
Messages (5)
msg72823 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2008-09-09 06:56
Hello. I failed to build py3k on cygwin (configure --without-threads).
It's because io.py imports _dummy_thread, and it imports traceback, and
it tries to import c-module itertools which is not built yet.

Attached file is workaround patch.

/////////////////////////////

Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
  File "/home/WhiteRabbit/python-dev/py3k/Lib/io.py", line 64, in <module>
    from _thread import allocate_lock as Lock
ImportError: No module named _thread

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/WhiteRabbit/python-dev/py3k/Lib/io.py", line 66, in <module>
    from _dummy_thread import allocate_lock as Lock
  File "/home/WhiteRabbit/python-dev/py3k/Lib/_dummy_thread.py", line
19, in <mo
dule>
    import traceback as _traceback
  File "/home/WhiteRabbit/python-dev/py3k/Lib/traceback.py", line 6, in
<module>

    import itertools
ImportError: No module named itertools
Aborted (core dumped)
msg72825 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2008-09-09 07:01
Sorry, I removed workaround patch. It was not simply working.:-(
msg72856 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2008-09-09 13:38
Simple workaround is to remove itertools from traceback module and write
equivalent code to itertools.chain.

I'm not sure it is acceptable put such limitation to standard library.
(That is, traceback is used from build process, so should not use C-module)
msg72870 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-09-09 15:12
Agreed. I suggest that you add a comment like
"itertools.chain is in an extension module and may be unavailable"
just above.
Otherwise, someday one will find that this code should use a function
from the stdlib, and revert your change...

Please apply it.
msg72890 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2008-09-09 17:55
Thanks, fixed in r66340(py3k).
History
Date User Action Args
2022-04-11 14:56:38adminsetgithub: 48062
2008-09-09 17:55:35ocean-citysetstatus: open -> closed
resolution: accepted -> fixed
messages: + msg72890
2008-09-09 15:12:11amaury.forgeotdarcsetresolution: accepted
messages: + msg72870
nosy: + amaury.forgeotdarc
2008-09-09 13:38:59ocean-citysetfiles: + py3k_remove_itertools_from_traceback.patch
messages: + msg72856
2008-09-09 07:01:13ocean-citysetmessages: + msg72825
2008-09-09 07:00:17ocean-citysetfiles: - py3k_workaround.patch
2008-09-09 06:56:38ocean-citycreate