[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-10-03 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6697 ___ ___ Python-bugs-list

[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The problem is actually wider:: getattr(None, \udc80) Segmentation fault An idea would be to change _PyUnicode_AsDefaultEncodedString and allow unpaired surrogates (utf8+surrogateescape, as explained in PEP383), but I fear the

[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-19 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Amaury Forgeot d'Arc wrote: Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The problem is actually wider:: getattr(None, \udc80) Segmentation fault An idea would be to change _PyUnicode_AsDefaultEncodedString and

[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Do you suggest to remove all usages of _PyUnicode_AsString() and _PyUnicode_AsStringAndSize()? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6697

[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-19 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Amaury Forgeot d'Arc wrote: Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Do you suggest to remove all usages of _PyUnicode_AsString() and _PyUnicode_AsStringAndSize()? In the short-term, I suggest that all uses that do

[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The %U format seems adequate for this purpose - actually PyObject_GenericSetAttr uses it already. Yes, the exception message will contain the same lone UTF-8 surrogates; this is not a problem because sys.stderr uses the backslashreplace

[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-19 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: It would be unfortunate to replace all usages of _PyUnicode_AsString to check the return value. I agree with MAL: we do need to check for errors returned from _PyUnicode_AsString, and it would be best if we created a fail-safe version of

[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: The error occurs in Py_Main(), on _PyUnicode_AsString(commandObj). The problem is that _PyUnicode_AsString() is not checked for error. Here is a patch fixing two errors: - display on error message instead of a crash on

[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-13 Thread Arfrever Frehtes Taifersar Arahesis
New submission from Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: Python 3.1 segfaults when invalid UTF-8 characters are passed from command line. In BASH shell you can run: $ python3.1 -c $'print(\x80)' Segmentation fault In other POSIX-compatible shells you can save the

[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-13 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- priority: - high stage: - test needed type: - crash ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6697 ___

[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-13 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- components: +Interpreter Core ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6697 ___ ___

[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-13 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment: I'm attaching crashers/invalid_utf8_characters_from_command_line.py. -- Added file: http://bugs.python.org/file14712/invalid_utf8_characters_from_command_line.py ___

[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-13 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: Removed file: http://bugs.python.org/file14712/invalid_utf8_characters_from_command_line.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6697

[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-13 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: Added file: http://bugs.python.org/file14713/invalid_utf8_characters_from_command_line.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6697

[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-13 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- stage: test needed - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6697 ___ ___