Skip to content

Commit

Permalink
1747: ignore preferred encoding and use utf-8 (fixes win32 consle wit…
Browse files Browse the repository at this point in the history
…h python3)

git-svn-id: https://xpra.org/svn/Xpra/trunk@18037 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jan 18, 2018
1 parent 22cd378 commit 29be4d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xpra/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1240,12 +1240,12 @@ def configure_logging(options, mode):
to = s
if sys.version_info[0]==3:
try:
import codecs, locale
import codecs
#print("locale.getpreferredencoding()=%s" % (locale.getpreferredencoding(),))
#python3 has a buffer attribute,
#which we must use if we want to be able to write bytes:
sbuf = getattr(s, "buffer", s)
to = codecs.getwriter(locale.getpreferredencoding())(sbuf, "replace")
to = codecs.getwriter("utf-8")(sbuf, "replace")
except:
pass
#a bit naughty here, but it's easier to let xpra.log initialize
Expand Down

0 comments on commit 29be4d9

Please sign in to comment.