Unable to import a ftml file from Windows on a Ubuntu machine
Traceback (most recent call last): File "/home/icg186/anaconda2/envs/mss/lib/python2.7/site-packages/mslib/msui/mss_pyui.py", line 512, in openFlightTrack filename = str(filename) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 21: ordinal not in range(128)
Comments (5)
-
-
Yep only Unicode. And not just open but codecs.open. This becomes easier at the moment we are on py3. Py3 requires also unicode.
-
The problem in this case seems to be the directoryname containing an umlaut, not the file itself. Fix is inbound and also the stable branch will be fixed.
-
- changed status to resolved
Changed str calls to unicode where actually unicode might occur.
This affects especially operations on filenames containing unicode characters and location/comments in Flightplans.
Resolve Issue
#121→ <<cset e456e012976a>>
-
Fix issue
#121in stable branchOnly apply the fix to filename handling as the other stuff has so far not caused problems.
→ <<cset 7123733dff83>>
- Log in to comment
This seems to be related to the conversion of QStrings to Python strings in PyQt4, which sometimes is not done consistently in unicode. Probably a good idea to review the code for these conversions and consistently use unicode...?