[issue6650] sre_parse contains a confusing generic error message
Torne Wuff added the comment: I suspect a better message could be invented, but I'm not sure what :) -- ___ Python tracker <http://bugs.python.org/issue6650> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6650] sre_parse contains a confusing generic error message
New submission from Torne Wuff : sre_parse raises an exception with the message "syntax error" - very generic and confusing - in the case where something that looks like a lookbehind assertion is invalid. >>> import re >>> re.match('(?.*)', 'foo') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/re.py", line 137, in match return _compile(pattern, flags).match(string) File "/usr/lib/python2.5/re.py", line 241, in _compile raise error, v # invalid expression sre_constants.error: syntax error This example is a typo for '(?P.*)' :) This is the only case in sre_parse where the message "syntax error" is used - the others are much more descriptive. Attached patch changes it to "bad lookbehind assertion type: %s" for python 2.x head; should be applied to 3.x also. -- components: Regular Expressions files: sre_error_msg.diff keywords: patch messages: 91324 nosy: torne severity: normal status: open title: sre_parse contains a confusing generic error message type: behavior versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file14659/sre_error_msg.diff ___ Python tracker <http://bugs.python.org/issue6650> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9060] Python/dup2.c doesn't compile on (at least) newlib
New submission from Torne Wuff : On systems without dup2(), Python tries to compile its own from Python/dup2.c, but this file refers to close() without including unistd.h. This causes it to not compile with newlib (and possibly other C libraries, presumably it was relying on fcntl.h indirectly including it?). This is probably true of all older versions as well, but Python 2.x doesn't appear to actually bother to compile dup2.c even if the system lacks dup2, so it doesn't actually cause a build error there. (building python for a semi-freestanding environment is "fun") -- components: Interpreter Core files: fix_dup2.patch keywords: patch messages: 108445 nosy: torne priority: normal severity: normal status: open title: Python/dup2.c doesn't compile on (at least) newlib type: compile error versions: Python 3.1 Added file: http://bugs.python.org/file17753/fix_dup2.patch ___ Python tracker <http://bugs.python.org/issue9060> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com