Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft WB py3 migration #16

Open
luzpaz opened this issue Feb 7, 2018 · 0 comments
Open

Draft WB py3 migration #16

luzpaz opened this issue Feb 7, 2018 · 0 comments

Comments

@luzpaz
Copy link

luzpaz commented Feb 7, 2018

Found this in the Draft WB source. thought you should know since you've been doing a lot of awesome work in migrating to py3

./src/Mod/Draft/Draft.py:
 5990                  plm = obj.Placement
 5991              ff8 = obj.FontFile.encode('utf8')                  # 1947 accents in filepath
 5992:                                                                # TODO: change for Py3?? bytes?
 5993                                                                 # Part.makeWireString uses FontFile as char* string
 5994  #            CharList = Part.makeWireString(obj.String,obj.FontFile,obj.Size,obj.Tracking)

./src/Mod/Draft/DraftGui.py:
 1450  #                    fname = utf8_decode(fname[0])  # 1947: utf8_decode fails ('ascii' codec can't encode character)
 1451                                                      # when fname[0] contains accented chars
 1452:                     fname = fname[0].encode('utf8') #TODO: this needs changing for Py3??
 1453                                                      # accented chars cause "UnicodeEncodeError" failure in DraftGui.todo without 
 1454                                                      # .encode('utf8')

./src/Mod/TechDraw/App/DrawViewClipPyImp.cpp:
   84      for( ; it != strings.end(); it++) {
   85  #if PY_MAJOR_VERSION < 3
   86:         PyObject* pString = PyString_FromString(it->c_str());           //TODO: unicode & py3
   87  #else
   88          PyObject* pString = PyUnicode_FromString(it->c_str());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant