On 06/16/2010 03:51 PM, Thomas Jollans wrote:
> On 06/16/2010 10:10 PM, Stuart McGraw wrote:
>> Note that the exceptions may be anything (I just used IOError
>> as an example) and are generated in bowels of an API that I
>> can't/won't mess with.
>
> Yeah, well, you'd have to special-case every
On 06/16/2010 03:53 PM, Martin v. Loewis wrote:
>> So how do I get what I want?
>
> Submit a patch. You would have to explain why this is a bug fix and not
> a new feature, as new features are not allowed anymore for 2.x.
Thanks. Actually I have no idea if this is a bug or a feature
(despite r
So how do I get what I want?
Submit a patch. You would have to explain why this is a bug fix and not
a new feature, as new features are not allowed anymore for 2.x.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
On 06/16/2010 10:10 PM, Stuart McGraw wrote:
> I am having a problem with exceptions and unicode.
>
> try: open ('file.txt')
> except IOError, e: pass
> str (e)
> => "[Errno 2] No such file or directory: 'file.txt'"
>
> which
I am having a problem with exceptions and unicode.
try: open ('file.txt')
except IOError, e: pass
str (e)
=> "[Errno 2] No such file or directory: 'file.txt'"
which is fine but...
try: open (u'フィイル.txt')
except IOError, e: pass
str (e)
This seems to work:
>>> import sys, traceback
>>> def excepthook(exctype, value, tb):
... if tb:
... lines = traceback.format_tb(tb)
... for i, line in zip(range(len(lines)), lines):
... lines[i] = lines[i].decode('utf8')
... lines.insert(0, u'Traceback (
On Mar 21, 6:03 am, Tuomas <[EMAIL PROTECTED]> wrote:
> This works:
> >>> raise StandardError(u'Wrong type')
> Traceback (most recent call last):
>File "", line 1, in ?
> StandardError: Wrong type
>
> but don't in Finnish:
> >>> raise StandardError(u'Väärä tyyppi')
> Traceback (most recent ca
On Mar 21, 6:03 am, Tuomas <[EMAIL PROTECTED]> wrote:
> This works:
> >>> raise StandardError(u'Wrong type')
> Traceback (most recent call last):
>File "", line 1, in ?
> StandardError: Wrong type
>
> but don't in Finnish:
> >>> raise StandardError(u'Väärä tyyppi')
> Traceback (most recent ca
Hey anybody please tell me...
How we can get the properties of a file in python
On 3/21/07, Tuomas <[EMAIL PROTECTED]> wrote:
This works:
>>> raise StandardError(u'Wrong type')
Traceback (most recent call last):
File "", line 1, in ?
StandardError: Wrong type
but don't in Finnish:
>>> r
This works:
>>> raise StandardError(u'Wrong type')
Traceback (most recent call last):
File "", line 1, in ?
StandardError: Wrong type
but don't in Finnish:
>>> raise StandardError(u'Väärä tyyppi')
Traceback (most recent call last):
File "", line 1, in ?
StandardError>>>
>>>
Any solution
10 matches
Mail list logo