betterman08 / pydelicious

Automatically exported from code.google.com/p/pydelicious
Other
0 stars 0 forks source link

Change in text encoding detection in ver 0.5.2-rc1 results in error as locale.getpreferredencoding() does not always return a useful result #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

In ver 0.5.2-rc1 (in contrast to version 0.5) the encoding is determined
via a call to locale.getpreferredencoding() unless its explicitly specified
in the DeliciousAPI constructor.

This however can results in an error because sometimes an empty string is
returned as the result. (I get this on my Mac OS X 10.5 machine using the
Apple provided python.) In pydelicious 0.5 the codec was defaulted to
'iso-8859-1' if not provided, hence I had no such issues. Maybe some sane
default or explicit error detection up front is required? Might save some
developer some debugging time :).

Just my 2 cents. 

Original issue reported on code.google.com by mohangk@gmail.com on 31 Jan 2009 at 6:48

GoogleCodeExporter commented 9 years ago
> Maybe some sane default or explicit error detection up front is required?
Sure, now checks for empty string. Defaulting that to 8859-1 is ok.

Darwin and perhaps other systems might need to be tested here. But I don't know 
what
or how to create unittests for that.
Leaving this open for a while in case it gives anyone else trouble.

Original comment by berend.v...@gmail.com on 2 Feb 2009 at 1:24

GoogleCodeExporter commented 9 years ago

Original comment by berend.v...@gmail.com on 11 Sep 2009 at 11:29