Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-17 Thread jhermann
Assuming those survived the switch to 3.0, you can use site.py und sys.displayhook to customize to the old behaviour (i.e. change it to a version using ascii instead of repr). Since this only affects interactive use, it's also no problem for portability of code, unlike "solutions" like forcing the

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-14 Thread Martin v. Löwis
> It's unfortunate that the default behaviour isn't > optimal at the interactive prompt for some configurations, though. As I said, it's a trade-off. The alternative, if it was the default, wouldn't be optimal at the interactive prompt for some other configurations. In particular, users of non-la

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-14 Thread Paul Boddie
On 14 Des, 22:13, "Martin v. Löwis" wrote: > > But shouldn't the production of an object's representation via repr be > > a "safe" operation? > > It's a trade-off. It should also be legible. Right. I can understand that unlike Python 2.x, a representation of a string in Python 3.x (whose equivale

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-14 Thread James Mills
On Mon, Dec 15, 2008 at 9:03 AM, Fuzzyman wrote: > It seems to me to be a generally accepted term when an application > stops due to an unhandled error to say that it crashed. it == application Yes. #!/usr/bin/env python from traceback import format_exc def foo(): print

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-14 Thread Fuzzyman
> That's an interesting definition of crash. You're just like saying: "C > has crashed because I made a bug in my program". In this context, it is > your program that crashes, not python nor C, it is misleading to say so. > > It will be python's crash if: > 1. Python 'segfault'ed > 2. Python inter

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-14 Thread Martin v. Löwis
> But shouldn't the production of an object's representation via repr be > a "safe" operation? It's a trade-off. It should also be legible. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-14 Thread Paul Boddie
On 14 Des, 05:46, "Martin v. Löwis" wrote: > > Yes. If you want a display that is guaranteed to work on your terminal, > use the ascii() builtin function. But shouldn't the production of an object's representation via repr be a "safe" operation? That is, the operation should always produce a resu

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-13 Thread Martin v. Löwis
> "Sure" as in "sure, it was not intended behaviour"? It was intended behavior, and still is in 3.0. >> This behavior has not changed. It still uses repr(). >> >> Of course, the string type has changed in 3.0, and now uses a different >> definition of repr. > > So was the above-reported non-cras

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-13 Thread Mark Tolonen
"John Machin" wrote in message news:a8cd683f-853d-4665-bee4-7a0bdb841...@c36g2000prc.googlegroups.com... On Dec 14, 9:20 am, "Martin v. Löwis" wrote: > >> This is intended behavior. > > > I see. That means that the behaviour in Python 1.6 to 2.6 (i.e. > > encoding the text using the repr() fu

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-13 Thread Lie Ryan
On Sat, 13 Dec 2008 14:09:04 -0800, John Machin wrote: > On Dec 14, 8:07 am, "Chris Rebert" wrote: >> On Sat, Dec 13, 2008 at 12:28 PM, John Machin >> wrote: >> >> > Python 2.6.1 (r261:67517, Dec  4 2008, 16:51:00) [MSC v.1500 32 bit >> > (Intel)] on win32 >> > Type "help", "copyright", "credits

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-13 Thread John Machin
On Dec 14, 9:20 am, "Martin v. Löwis" wrote: > >> This is intended behavior. > > > I see. That means that the behaviour in Python 1.6 to 2.6 (i.e. > > encoding the text using the repr() function (as then defined) was not > > intended behaviour? > > Sure. "Sure" as in "sure, it was not intended be

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-13 Thread Martin v. Löwis
>> This is intended behavior. > > I see. That means that the behaviour in Python 1.6 to 2.6 (i.e. > encoding the text using the repr() function (as then defined) was not > intended behaviour? Sure. This behavior has not changed. It still uses repr(). Of course, the string type has changed in 3.0

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-13 Thread John Machin
On Dec 14, 8:07 am, "Chris Rebert" wrote: > On Sat, Dec 13, 2008 at 12:28 PM, John Machin wrote: > > > Python 2.6.1 (r261:67517, Dec  4 2008, 16:51:00) [MSC v.1500 32 bit > > (Intel)] on win32 > > Type "help", "copyright", "credits" or "license" for more information. > x = u'\u9876' > x

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-13 Thread Chris Rebert
On Sat, Dec 13, 2008 at 12:28 PM, John Machin wrote: > > Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit > (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. x = u'\u9876' x > u'\u9876' > > # As expected > > Python 3.0 (r30:6750

Re: Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-13 Thread Vlastimil Brom
2008/12/13 John Machin : > > Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit > (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. x = u'\u9876' x > u'\u9876' > > # As expected > > Python 3.0 (r30:67507, Dec 3 2008, 20:14:27) [MS

Python 3.0 crashes displaying Unicode at interactive prompt

2008-12-13 Thread John Machin
Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> x = u'\u9876' >>> x u'\u9876' # As expected Python 3.0 (r30:67507, Dec 3 2008, 20:14:27) [MSC v.1500 32 bit (Intel)] on win 32 Type "h