[issue9198] Should repr() print unicode characters outside the BMP?

2010-12-01 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I created a new issue for Ezio's proposition to patch sys.displayhook: issue #10601. To answer the initial question, Should repr() print unicode characters outside the BMP?, Marc-Andre, Ezio and me agree that we should keep the

[issue9198] Should repr() print unicode characters outside the BMP?

2010-12-01 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9198 ___

[issue9198] Should repr() print unicode characters outside the BMP?

2010-11-19 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +belopolsky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9198 ___ ___ Python-bugs-list

[issue9198] Should repr() print unicode characters outside the BMP?

2010-08-12 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: About issue9198.diff: - exit directly if !PyErr_ExceptionMatches(PyExc_UnicodeEncodeError) to avoid an useless level of indentation - why do you clear the exception before calling PyObject_Repr()? if you cannot execute code while

[issue9198] Should repr() print unicode characters outside the BMP?

2010-08-07 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +merwok ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9198 ___ ___ Python-bugs-list mailing

[issue9198] Should repr() print unicode characters outside the BMP?

2010-08-06 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Assigning to myself so that I'll remember to finish and commit the patch. -- assignee: - ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9198

[issue9198] Should repr() print unicode characters outside the BMP?

2010-07-09 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Here is a patch to fix sys_displayhook (note: the patch is just a proof of concept -- it seems to work fine but I still have to clean it up, add comments, rename and reorganize some vars and add tests). This is an example output while

[issue9198] Should repr() print unicode characters outside the BMP?

2010-07-08 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc amaur...@gmail.com: On wide unicode builds, '\U0001'.isprintable() returns True, and repr() returns the character unmodified. Is it a good behavior, given that very few fonts have can display this character? Marc-Andre Lemburg wrote: The printable

[issue9198] Should repr() print unicode characters outside the BMP?

2010-07-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: [Adding some bits from the discussion on #5127 for better context] Ezio Melotti wrote: Ezio Melotti ezio.melo...@gmail.com added the comment: [This should probably be discussed on python-dev or in another issue, so feel free to

[issue9198] Should repr() print unicode characters outside the BMP?

2010-07-08 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Regarding the fonts, I think that who actually uses or needs to use characters outside the BMP might have (now or in a few months/years) a font able to display them. I also tried to print the printable chars from U+ to U+1 on my

[issue9198] Should repr() print unicode characters outside the BMP?

2010-07-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: A more accurate approach would be to actually try to encode the string and escape only the chars that can't be encoded This is already the case with sys.stderr, it uses the backslashreplace error handler. Do you suggest the same for

[issue9198] Should repr() print unicode characters outside the BMP?

2010-07-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Yes, repr() should not depend on the user's terminal. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9198 ___

[issue9198] Should repr() print unicode characters outside the BMP?

2010-07-08 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: This is already the case with sys.stderr, it uses the backslashreplace error handler. Do you suggest the same for sys.stdout? See http://bugs.python.org/issue5110#msg84965 -- ___ Python

[issue9198] Should repr() print unicode characters outside the BMP?

2010-07-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The chapter Rationale in PEP3138 explains why sys.stdout uses strict encoding, when sys.stderr uses backslashreplace. It would be possible to use backslashreplace for stdout as well for interactive sessions, but the PEP also rejected

[issue9198] Should repr() print unicode characters outside the BMP?

2010-07-08 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9198 ___ ___

[issue9198] Should repr() print unicode characters outside the BMP?

2010-07-08 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Yes, but as I said in the message I linked, that's *not* what I want to do. I want to change only the behavior of the interactive interpreter and only when the string sent to stdout is not encodable (so only when the encoding is not

[issue9198] Should repr() print unicode characters outside the BMP?

2010-07-08 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I think if you change it stop considering non-BMP characters as printable, somebody will complain. If you change it in any other way, somebody will complain. Somebody will always complain - so you might as well leave things the way they

[issue9198] Should repr() print unicode characters outside the BMP?

2010-07-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: amaury Should repr() print unicode characters outside the BMP? Yes. I don't understand why characters outside the BMP will be considered differently than other characters. Is it a workaround for bogus operating systems? My Linux

[issue9198] Should repr() print unicode characters outside the BMP?

2010-07-08 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: I suggest to: 1) keep the current behavior for non-BMP chars (i.e. print them normally); 2) change isprintable to consider the Zx categories printable (this will affect repr() too); 3) change displayhook (*NOT* sys.stdout.encoding) to

[issue9198] Should repr() print unicode characters outside the BMP?

2010-07-08 Thread Adam Olsen
Changes by Adam Olsen rha...@gmail.com: -- nosy: +Rhamphoryncus ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9198 ___ ___ Python-bugs-list