Revision: 4585 Author: misza13 Date: 2007-11-21 22:48:58 +0000 (Wed, 21 Nov 2007)
Log Message: ----------- Catching an error possible when using pywikipedia inside a twisted application. (StdioOnnaStick instance has no attribute 'encoding')
Modified Paths: -------------- trunk/pywikipedia/config.py
Modified: trunk/pywikipedia/config.py =================================================================== --- trunk/pywikipedia/config.py 2007-11-21 20:59:46 UTC (rev 4584) +++ trunk/pywikipedia/config.py 2007-11-21 22:48:58 UTC (rev 4585) @@ -93,7 +93,12 @@ # or 'utf-8'. # This default code should work fine, so you don't have to think about it. # TODO: consider getting rid of this config variable. -console_encoding = __sys.stdout.encoding +try: + console_encoding = __sys.stdout.encoding +except: + #When using pywikipedia inside a daemonized twisted application, + #we get "StdioOnnaStick instance has no attribute 'encoding'" + console_encoding = None
# The encoding in which textfiles are stored, which contain lists of page titles. textfile_encoding = 'utf-8'