Show
Ignore:
Timestamp:
01/24/08 10:12:48 (16 years ago)
Author:
jerome
Message:

It seems that the lead developer can eat his own food again...
More testing needs to be done but printing should now work again at
least with the PostgreSQL backend.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/tool.py

    r3295 r3298  
    9696        # Saves a copy of the locale settings 
    9797        (self.language, self.charset) = locale.getlocale() 
     98        if not self.language : 
     99            self.language = "C" 
    98100        if not self.charset : 
    99101            self.charset = "UTF-8" 
     
    165167        """Display a message but only if stdout is a tty.""" 
    166168        if sys.stdout.isatty() : 
    167             sys.stdout.write(message.encode(sys.stdout.encoding or "UTF-8", \ 
     169            sys.stdout.write(message.encode(self.charset, \ 
    168170                                            "replace")) 
    169171            sys.stdout.flush() 
     
    172174        """Logs something to debug output if debug is enabled.""" 
    173175        if self.debug : 
    174             self.logger.log_message(message.encode(sys.stdout.encoding \ 
    175                                                        or "UTF-8", \ 
     176            self.logger.log_message(message.encode(self.charset, \ 
    176177                                                   "replace"), \ 
    177178                                    "debug") 
     
    180181        """Sends a message to standard error.""" 
    181182        sys.stderr.write("%s: %s\n" % (level.upper(), \ 
    182                                        message.encode(sys.stdout.encoding \ 
    183                                                           or "UTF-8", \ 
     183                                       message.encode(self.charset, \ 
    184184                                                      "replace"))) 
    185185        sys.stderr.flush()