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: regrtest fails with "RuntimeError: maximum recursion depth exceeded" in some cases
Type: behavior Stage: resolved
Components: Tests Versions: Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: flox Nosy List: amaury.forgeotdarc, cjw296, ezio.melotti, flox
Priority: normal Keywords: patch

Created on 2010-01-27 00:15 by flox, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_multibytecodec.patch amaury.forgeotdarc, 2010-01-27 09:46
Messages (5)
msg98392 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-01-27 00:15
~ $ ./python -m test.regrtest -R 1:0: test_multibytecodec_support test_codecencodings_tw test_codecencodings_jp

test_multibytecodec_support
test_codecencodings_tw
test test_codecencodings_tw failed -- Traceback (most recent call last):
  File "./Lib/test/test_multibytecodec_support.py", line 88, in test_customreplace_encode
    "test.xmlcharnamereplace")[0], sout)
  File "./Lib/test/test_multibytecodec_support.py", line 74, in xmlcharnamereplace
    if ord(c) in codepoint2name:
  File "./Lib/test/test_multibytecodec_support.py", line 260, in ord
    return _ord(c)
  File "./Lib/test/test_multibytecodec_support.py", line 260, in ord
    return _ord(c)
  File "./Lib/test/test_multibytecodec_support.py", line 260, in ord
    return _ord(c)
(...)
RuntimeError: maximum recursion depth exceeded

test_codecencodings_jp
test test_codecencodings_jp failed -- multiple errors occurred; run in verbose mode for details
1 test OK.
2 tests failed:
    test_codecencodings_jp test_codecencodings_tw
msg98409 - (view) Author: Chris Withers (cjw296) * (Python committer) Date: 2010-01-27 09:38
Can you try and list what the cases are which cause this failure to occur?
msg98410 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2010-01-27 09:46
The module is probably reloaded, which causes code like:
    _ord = ord
    def ord(c):
        ... _ord(c) ...
to form a recursion loop.
Attached patch removes the need for a special ord().

All this should be simply removed in py3k branch: ord() and chr() do the right thing even on narrow unicode builds.
msg98446 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-01-27 18:28
Thank you for the patch and the analysis.
It fixes the recursion.
msg100187 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-02-27 16:23
Fixed in r78497.
History
Date User Action Args
2022-04-11 14:56:56adminsetgithub: 52041
2010-02-27 16:23:08floxsetstatus: open -> closed
resolution: accepted -> fixed
messages: + msg100187

stage: patch review -> resolved
2010-02-27 14:49:42floxsetassignee: flox
resolution: accepted
2010-01-27 18:28:25floxsetmessages: + msg98446
stage: test needed -> patch review
2010-01-27 09:46:30amaury.forgeotdarcsetfiles: + test_multibytecodec.patch

nosy: + amaury.forgeotdarc
messages: + msg98410

keywords: + patch
2010-01-27 09:38:02cjw296setnosy: + cjw296
messages: + msg98409
2010-01-27 01:10:48ezio.melottisetnosy: + ezio.melotti
2010-01-27 00:15:36floxcreate