PrzemoF wrote: ↑Thu Mar 07, 2019 7:33 pm
Did you test it under python2 as well or it's python3 only now? I can't make it work.
With
OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14976 (Git)
Build type: Release
Branch: (HEAD detached at e79a19828)
Hash: e79a19828e2e92269ff96110dfeadaa245ad17c2
Python version: 2.7.15
Qt version: 5.11.2
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: French/France (fr_FR)
I've got an issue while loading a .csv file but everything else works.
I'm looking to solve it.
with open(filename, 'r', encoding="utf-8") as csvfile: doesn't work under python2
(should use
with open(filename, 'r') as csvfile:).
But then, I've got another error :
Code: Select all
reader = csv.DictReader(csvfile, delimiter='\t')
File "/Applications/FreeCAD.app/Contents/lib/python2.7/csv.py", line 79, in __init__
self.reader = reader(f, dialect, *args, **kwds)
TypeError: "delimiter" must be string, not unicode
I'm investigating all changes I might have done...
EDIT : I have something that is working
replacing
Code: Select all
with open(filename, 'r', encoding="utf-8") as csvfile:
by
Code: Select all
with open(filename, 'r') as csvfile:
reader = csv.DictReader(csvfile, delimiter=str('\t').encode('utf-8'))
I'm writing it to make it work automatically for both python2 and 3 and push it.
I didn't asked : Was that your problem ?
EDIT 2 : modification pushed (available in the addon manager)