Revision: 4479
Author: cosoleto
Date: 2007-10-25 13:47:01 +0000 (Thu, 25 Oct 2007)
Log Message:
-----------
bugfix: console_encoding default value is set to 'None' when output is redirected
(for this reason a cron job fail and return "TypeError: encode() argument 1 must be
string, not None").
Modified Paths:
--------------
trunk/pywikipedia/config.py
Modified: trunk/pywikipedia/config.py
===================================================================
--- trunk/pywikipedia/config.py 2007-10-24 15:38:24 UTC (rev 4478)
+++ trunk/pywikipedia/config.py 2007-10-25 13:47:01 UTC (rev 4479)
@@ -429,8 +429,15 @@
print " Now: ",nt
del nt,ot
else:
- print "WARNING: Configuration variable %r is defined but unknown.
Misspelled?"%_key
+ print "WARNING: Configuration variable %r is defined but unknown.
Misspelled?" %_key
+# Fix up default console_encoding
+if console_encoding == None:
+ if __sys.platform=='win32':
+ console_encoding = 'cp850'
+ else:
+ console_encoding = 'iso-8859-1'
+
# Save base_dir for use by other modules
base_dir = _base_dir
#
Show replies by thread