google / adb-sync

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

str/bytes/encoding problems on Windows

cfbao opened this issue · comments

  • On Windows, subprocess.Popen process arguments as strings, and problem arises when bytes are passed in (a bytes-like object is required, not 'str').
  • Python 3.6 now uses UTF-8 for Windows filesystem and console encoding. Using locale.getdefaultlocale()[1] is not appropriate in this case.

I modified the script, changing all bytes to str and using UTF-8 only, and got a working script on my system (Win 7, Python 3.6), but it probably doesn't work on many other systems. Would love to see this tool improved in this regard.

Yup no support for anything else than ASCII here, fails on Linux too. This sucks.

hey @cfbao i ran into the exact same problem and would appreciate it if you would share your modified script.