On Tue, Feb 8, 2011 at 5:41 PM, Chris Rebert wrote:
> On Tue, Feb 8, 2011 at 7:57 AM, Rickard Lindberg wrote:
>> Hi,
>>
>> Here is a bash script to reproduce my error:
>
> Including the error message and traceback is still helpful, for future
> reference.
>
>> #!/bin/sh
>>
>> cat > å.timeli
Rickard Lindberg, 09.02.2011 14:01:
Did you read my reply?
Sorry, it was me who failed to read your question properly.
Unicode file names aren't really working well, especially not in Py2.x.
Python 3.2 provides many improvements here.
I assume your file system encoding is UTF-8? What does
sys
>> Did you read my reply?
>
>Sorry, it was me who failed to read your question properly.
>
>Unicode file names aren't really working well, especially not in Py2.x.
>Python 3.2 provides many improvements here.
>
>I assume your file system encoding is UTF-8? What does
>sys.getfilesystemencoding() giv
Stefan Behnel, 09.02.2011 09:58:
Rickard Lindberg, 09.02.2011 09:32:
On Tue, Feb 8, 2011 at 5:41 PM, Chris Rebert wrote:
Here is a bash script to reproduce my error:
Including the error message and traceback is still helpful, for future
reference.
Thanks for pointing it out.
#!/bin/sh
ca
Rickard Lindberg, 09.02.2011 09:32:
On Tue, Feb 8, 2011 at 5:41 PM, Chris Rebert wrote:
Here is a bash script to reproduce my error:
Including the error message and traceback is still helpful, for future
reference.
Thanks for pointing it out.
#!/bin/sh
cat> å.timeline<
EOF
On Tue, Feb 8, 2011 at 5:41 PM, Chris Rebert wrote:
>> Here is a bash script to reproduce my error:
>
> Including the error message and traceback is still helpful, for future
> reference.
Thanks for pointing it out.
>> #!/bin/sh
>>
>> cat > å.timeline <
>> EOF
>>
>> python <> # e
Rickard Lindberg, 08.02.2011 16:57:
Hi,
Here is a bash script to reproduce my error:
#!/bin/sh
cat> å.timeline<
0.13.0devb38ace0a572b+
2011-02-01 00:00:00
2011-02-03 08:46:00
asdsd
On Tue, Feb 8, 2011 at 7:57 AM, Rickard Lindberg wrote:
> Hi,
>
> Here is a bash script to reproduce my error:
Including the error message and traceback is still helpful, for future
reference.
> #!/bin/sh
>
> cat > å.timeline <
> EOF
>
> python < # encoding: utf-8
> from xml.sa
In <4c5d4ad9$0$28666$c3e8...@news.astraweb.com> Steven D'Aprano
writes:
>On Sat, 07 Aug 2010 19:28:56 +1200, Gregory Ewing wrote:
>> Steven D'Aprano wrote:
>>> "No memory? No disk space? No problem! Just a flesh wound!" What's
>>> the point of that?
>>
>> +1 QOTW
>While I'm always happy to
Steven D'Aprano wrote:
"No memory? No disk space? No problem! Just a flesh
wound!" What's the point of that?
+1 QOTW
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 06 Aug 2010 11:23:50 +, kj wrote:
> I don't get your point. Even when I *know* that a certain exception may
> happen, I don't necessarily catch it. I catch only those exceptions for
> which I can think of a suitable response that is *different* from just
> letting the program fail.
In Nobody
writes:
>On Fri, 23 Jul 2010 10:42:26 +, Steven D'Aprano wrote:
>> Don't write bare excepts, always catch the error you want and nothing
>> else.
>That advice would make more sense if it was possible to know which
>exceptions could be raised. In practice, that isn't possible, a
In article ,
Nobody wrote:
>
>Java's checked exception mechanism was based on real-world experience of
>the pitfalls of abstract types. And that experience was gained in
>environments where interface specifications were far more detailed than is
>the norm in the Python world.
There are a number
On Sun, 25 Jul 2010 14:47:11 +, Steven D'Aprano wrote:
>>> But in the
>>> meanwhile, once you get an error, you know what it is. You can
>>> intentionally feed code bad data and see what you get. And then maybe
>>> add a test to make sure your code traps such errors.
>>
>> That doesn't really
On Sun, 25 Jul 2010 13:52:33 +0100, Nobody wrote:
> On Fri, 23 Jul 2010 18:27:50 -0400, Terry Reedy wrote:
>
>> But in the
>> meanwhile, once you get an error, you know what it is. You can
>> intentionally feed code bad data and see what you get. And then maybe
>> add a test to make sure your cod
On Fri, 23 Jul 2010 18:27:50 -0400, Terry Reedy wrote:
> But in the
> meanwhile, once you get an error, you know what it is. You can
> intentionally feed code bad data and see what you get. And then maybe
> add a test to make sure your code traps such errors.
That doesn't really help with exce
dirknbr gmail.com> writes:
> I have kind of developped this but obviously it's not nice, any better
> ideas?
>
> try:
> text=texts[i]
> text=text.encode('latin-1')
> text=text.encode('utf-8')
> except:
> text=' '
As Steven has poin
On Fri, 23 Jul 2010 22:46:46 +0100, Nobody wrote:
> On Fri, 23 Jul 2010 10:42:26 +, Steven D'Aprano wrote:
>
>> Don't write bare excepts, always catch the error you want and nothing
>> else.
>
> That advice would make more sense if it was possible to know which
> exceptions could be raised.
On 7/23/2010 5:46 PM, Nobody wrote:
On Fri, 23 Jul 2010 10:42:26 +, Steven D'Aprano wrote:
Don't write bare excepts, always catch the error you want and nothing
else.
That advice would make more sense if it was possible to know which
exceptions could be raised. In practice, that isn't pos
On 07/23/2010 11:46 PM, Nobody wrote:
> On Fri, 23 Jul 2010 10:42:26 +, Steven D'Aprano wrote:
>
>> Don't write bare excepts, always catch the error you want and nothing
>> else.
>
> That advice would make more sense if it was possible to know which
> exceptions could be raised. In practice,
On Fri, Jul 23, 2010 at 2:46 PM, Nobody wrote:
> On Fri, 23 Jul 2010 10:42:26 +, Steven D'Aprano wrote:
>
>> Don't write bare excepts, always catch the error you want and nothing
>> else.
>
> That advice would make more sense if it was possible to know which
> exceptions could be raised. In pr
On Fri, 23 Jul 2010 10:42:26 +, Steven D'Aprano wrote:
> Don't write bare excepts, always catch the error you want and nothing
> else.
That advice would make more sense if it was possible to know which
exceptions could be raised. In practice, that isn't possible, as the
documentation seldom
On 07/23/2010 12:56 PM, dirknbr wrote:
> To give a bit of context. I am using twython which is a wrapper for
> the JSON API
>
>
> search=twitter.searchTwitter(s,rpp=100,page=str(it),result_type='recent',lang='en')
> for u in search[u'results']:
> ids.append(u[u'id'])
>
To give a bit of context. I am using twython which is a wrapper for
the JSON API
search=twitter.searchTwitter(s,rpp=100,page=str(it),result_type='recent',lang='en')
for u in search[u'results']:
ids.append(u[u'id'])
texts.append(u[u'text'])
This is where texts com
On Fri, Jul 23, 2010 at 3:14 AM, dirknbr wrote:
> I am having some problems with unicode from json.
>
> This is the error I get
>
> UnicodeEncodeError: 'ascii' codec can't encode character u'\x93' in
> position 61: ordinal not in range(128)
Please include the full Traceback and the actual code th
On Fri, 23 Jul 2010 03:14:11 -0700, dirknbr wrote:
> I am having some problems with unicode from json.
>
> This is the error I get
>
> UnicodeEncodeError: 'ascii' codec can't encode character u'\x93' in
> position 61: ordinal not in range(128)
>
> I have kind of developped this but obviously it
[EMAIL PROTECTED] wrote:
> On Jan 30, 11:28 pm, Walter Dörwald <[EMAIL PROTECTED]> wrote:
>
>> codecs.register_error("transliterate", transliterate)
>>
>>Walter
>
> Really, really slick solution.
> Though, why was it [:1], not [0]? ;-)
No particular reason, unicodedata.normalize("NFD", ...)
Martin v. Löwis wrote:
> Walter Dörwald schrieb:
>> You might try the following:
>>
>> # -*- coding: iso-8859-1 -*-
>>
>> import unicodedata, codecs
>>
>> def transliterate(exc):
>> if not isinstance(exc, UnicodeEncodeError):
>> raise TypeError("don'ty know how to handle %r" % r)
En Wed, 31 Jan 2007 01:21:49 -0300, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> escribió:
> I don't understand what %r and r are and where they are from. The man
> 3 printf page doesn't have %r formatting.
Perhaps you should look into the Python docs instead?
--
Gabriel Genellina
--
http://mail.p
Walter Dörwald schrieb:
> You might try the following:
>
> # -*- coding: iso-8859-1 -*-
>
> import unicodedata, codecs
>
> def transliterate(exc):
> if not isinstance(exc, UnicodeEncodeError):
> raise TypeError("don'ty know how to handle %r" % r)
> return (unicodedata.n
On Jan 30, 11:28 pm, Walter Dörwald <[EMAIL PROTECTED]> wrote:
>
> codecs.register_error("transliterate", transliterate)
>
>Walter
Really, really slick solution.
Though, why was it [:1], not [0]? ;-)
And one more thing:
> def transliterate(exc):
> if not isinstance(exc, UnicodeEncode
Rares Vernica wrote:
> Hi,
>
> Does anyone know of any Unicode encode/decode error handler that does a
> better replace job than the default replace error handler?
>
> For example I have an iso-8859-1 string that has an 'e' with an accent
> (you know, the French 'e's). When I use s.encode('asci
It does the job.
Thanks a lot,
Ray
Peter Otten wrote:
> Rares Vernica wrote:
>
>> Is there an encode/decode error handler that can replace all the
>> not-ascii letters from iso-8859-1 with their closest ascii letter?
>
> A mapping, not an error handler, but it might do the job:
>
> http://effb
Rares Vernica wrote:
> Is there an encode/decode error handler that can replace all the
> not-ascii letters from iso-8859-1 with their closest ascii letter?
No, but IBM's ICU library can transform one script to another in very flexible
and capable ways. One such configuration can do what you ask.
Rares Vernica wrote:
> Is there an encode/decode error handler that can replace all the
> not-ascii letters from iso-8859-1 with their closest ascii letter?
A mapping, not an error handler, but it might do the job:
http://effbot.org/zone/unicode-convert.htm
Peter
--
http://mail.python.org/mail
[Gallagher, Tim (NE)]
| Hey all I am learning Python and having a fun time doing so.
| I have a question for y'all, it has to do with active directory.
| I want to get the last login for a computer from Active
| Directory. I am using the active_directory module and here
| is my code.
[START
[EMAIL PROTECTED] wrote:
> I have this python code:
> print >> htmlFile, " style=\"width: 200px; height:18px;\">";
>
>
> But that caues this error, and I can't figure it out why. Any help is
> appreicate
> File "./run.py", line 193, in ?
> print >> htmlFile, " style=\"width: 200px; height:18
[EMAIL PROTECTED] wrote:
> I have this python code:
> print >> htmlFile, " style=\"width: 200px; height:18px;\">";
>
>
> But that caues this error, and I can't figure it out why. Any help is
> appreicate
> File "./run.py", line 193, in ?
> print >> htmlFile, " style=\"width: 200px; height:18
Erik Bethke wrote:
> Hello All,
>
> I still shaking out my last few bugs in my tile matching game:
>
> I am now down to one stumper for me:
> 1) when I initialize wxPython
> 2) from an exe that I have created with py2exe
> 3) when the executable is located on the desktop as opposed to
> somewhe
39 matches
Mail list logo