copy and paste of text into Python console produces chinese

Bug #1686800 reported by richard aras
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
New
Undecided
Unassigned

Bug Description

On mac OSX 10.12.4, copying and pasting text from other applications yields Chinese characters rather than roman and therefore produces Python errors.

Kicad version 70c961f

Tags: python
Revision history for this message
richard aras (raras) wrote :

Example:===========================
Application: kicad
Version: (2017-04-07 revision 70c961f)-master, release build
Libraries: wxWidgets 3.0.2
           libcurl/7.51.0 SecureTransport zlib/1.2.8
Py 0.9.8
Python 2.7.10 (default, Feb 6 2017, 23:53:20)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Startup script executed: /Users/richard2/Library/Preferences/kicad/PyShell_pcbnew_startup.py
偁䥈
  File "<input>", line 1
Traceback (most recent call last):
  File "/Applications/Kicad/kicad.app/Contents/Frameworks/python/site-packages/wx-3.0-osx_cocoa/wx/py/shell.py", line 562, in OnKeyDown
    self.processLine()
  File "/Applications/Kicad/kicad.app/Contents/Frameworks/python/site-packages/wx-3.0-osx_cocoa/wx/py/shell.py", line 886, in processLine
    self.push(command)
  File "/Applications/Kicad/kicad.app/Contents/Frameworks/python/site-packages/wx-3.0-osx_cocoa/wx/py/shell.py", line 976, in push
    self.more = self.interp.push(command)
  File "/Applications/Kicad/kicad.app/Contents/Frameworks/python/site-packages/wx-3.0-osx_cocoa/wx/py/interpreter.py", line 80, in push
    more = self.more = self.runsource(source)
  File "/Applications/Kicad/kicad.app/Contents/Frameworks/python/site-packages/wx-3.0-osx_cocoa/wx/py/interpreter.py", line 90, in runsource
    more = InteractiveInterpreter.runsource(self, source)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/code.py", line 79, in runsource
    self.showsyntaxerror(filename)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/code.py", line 139, in showsyntaxerror
    map(self.write, list)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/code.py", line 171, in write
    sys.stderr.write(data)
  File "/Applications/Kicad/kicad.app/Contents/Frameworks/python/site-packages/wx-3.0-osx_cocoa/wx/py/shell.py", line 1247, in writeErr
    self.write(text)
  File "/Applications/Kicad/kicad.app/Contents/Frameworks/python/site-packages/wx-3.0-osx_cocoa/wx/py/shell.py", line 1001, in write
    self.AddText(text)
  File "/Applications/Kicad/kicad.app/Contents/Frameworks/python/site-packages/wx-3.0-osx_cocoa/wx/stc.py", line 2041, in AddText
    return _stc.StyledTextCtrl_AddText(*args, **kwargs)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 4: ordinal not in range(128)

Better release information:======================================

Platform: Mac OS X (Darwin 16.5.0 x86_64), 64 bit, Little endian, wxMac
- Build Info -
wxWidgets: 3.0.2 (UTF-8,STL containers,compatible with 2.8)
Boost: 1.61.0
Curl: 7.43.0
KiCad - Compiler: Clang 7.3.0 with C++ ABI 1002
        Settings: USE_WX_GRAPHICS_CONTEXT=ON
                  USE_WX_OVERLAY=ON
                  KICAD_SCRIPTING=ON
                  KICAD_SCRIPTING_MODULES=ON
                  KICAD_SCRIPTING_WXPYTHON=ON
                  KICAD_SCRIPTING_ACTION_MENU=ON
                  BUILD_GITHUB_PLUGIN=ON
                  KICAD_USE_OCE=ON

Revision history for this message
David Pearce (halzia) wrote :

0xe5 is not unicode, but could be extended ascii "å"

tags: added: python
Revision history for this message
xzcvczx (xzcvczx) wrote :

please search for duplicates before making new bugs

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.