This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Survive unicode push ids.

  • Loading branch information...
spladug committed Jun 21, 2012
1 parent 1af0342 commit 211538e5cbd896eba7e174c0b41410c1c73024c9
Showing with 6 additions and 5 deletions.
  1. +2 −1 push/log.py
  2. +2 −2 push/syslog.py
  3. +1 −1 push/utils.py
  4. +1 −1 setup.py
View
@@ -1,5 +1,6 @@
import os
import sys
+import codecs
import getpass
import datetime
@@ -39,7 +40,7 @@ def __init__(self, config, args):
self.log_path = os.path.join(config.paths.log_root, log_name)
# open the logfile
- self.logfile = open(self.log_path, "w")
+ self.logfile = codecs.open(self.log_path, "w", "utf-8")
def write(self, text, color=None, bold=False, newline=False, stdout=True):
suffix = "\n" if newline else ""
View
@@ -2,11 +2,11 @@
import syslog
import getpass
-import functools
def register(config, args, deployer, log):
- write_syslog = functools.partial(syslog.syslog, config.syslog.priority)
+ def write_syslog(message):
+ syslog.syslog(config.syslog.priority, message.encode('utf-8'))
syslog.openlog(ident=config.syslog.ident, facility=config.syslog.facility)
View
@@ -11,7 +11,7 @@ def get_random_word(config):
position = random.randint(1, file_size)
wordlist.seek(position)
wordlist.readline()
- word = wordlist.readline().rstrip("\n")
+ word = unicode(wordlist.readline().rstrip("\n"), 'utf-8')
return word
View
@@ -7,7 +7,7 @@
version="",
packages=["push"],
install_requires=[
- "wessex>=1.2",
+ "wessex>=1.3.1",
"paramiko",
"dnspython",
],

0 comments on commit 211538e

Please sign in to comment.