Skip to content

Add a Tree widget (when label is None and value ends with '.json' or '.xml' and when value is a dict)#67

Open
fgallaire wants to merge 15 commits intoPierreRaybaut:masterfrom
fgallaire:tree
Open

Add a Tree widget (when label is None and value ends with '.json' or '.xml' and when value is a dict)#67
fgallaire wants to merge 15 commits intoPierreRaybaut:masterfrom
fgallaire:tree

Conversation

@fgallaire
Copy link
Copy Markdown
Collaborator

No description provided.

@fgallaire fgallaire changed the title Add a Tree widget (when label is None and value ends with '.json') Add a Tree widget (when label is None and value ends with '.json' or '.xml') Jun 20, 2016
@fgallaire fgallaire changed the title Add a Tree widget (when label is None and value ends with '.json' or '.xml') Add a Tree widget (when label is None and value ends with '.json' or '.xml' and when value is a dict) Jun 26, 2016
@fgallaire fgallaire force-pushed the tree branch 2 times, most recently from 33fb3e8 to e5cb27c Compare July 1, 2016 01:49
@PierreRaybaut
Copy link
Copy Markdown
Owner

With Python 3.4.4 64bits on Windows:

Traceback (most recent call last):
  File "C:\Python\formlayout\examples\tree.py", line 37, in <module>
    print('result:', fedit(datalist, title='Tree examples', type='questions'))
  File "C:\Python\formlayout\formlayout.py", line 1285, in fedit
    apply, ok, cancel, result, outfile, type, scrollbar)
  File "C:\Python\formlayout\formlayout.py", line 1093, in __init__
    self.formwidget.setup()
  File "C:\Python\formlayout\formlayout.py", line 640, in setup
    object_pairs_hook=OrderedDict)
  File "C:\WinPython-64bit-3.4.4.3\python-3.4.4.amd64\lib\json\__init__.py", line 268, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "C:\WinPython-64bit-3.4.4.3\python-3.4.4.amd64\lib\json\__init__.py", line 331, in loads
    return cls(**kw).decode(s)
  File "C:\WinPython-64bit-3.4.4.3\python-3.4.4.amd64\lib\json\decoder.py", line 343, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\WinPython-64bit-3.4.4.3\python-3.4.4.amd64\lib\json\decoder.py", line 361, in raw_decode
    raise ValueError(errmsg("Expecting value", s, err.value)) from None
ValueError: Expecting value: line 1 column 1 (char 0)

@fgallaire
Copy link
Copy Markdown
Collaborator Author

I can't test my fix, so tell me if it's good.
"The default encoding is platform dependent (whatever locale.getpreferredencoding() returns)"

@PierreRaybaut
Copy link
Copy Markdown
Owner

There is still the same traceback with Python 3.5:

Traceback (most recent call last):
  File "C:\Python\formlayout\examples\tree.py", line 37, in <module>
    print('result:', fedit(datalist, title='Tree examples', type='questions'))
  File "C:\Python\formlayout\formlayout.py", line 1289, in fedit
    apply, ok, cancel, result, outfile, type, scrollbar)
  File "C:\Python\formlayout\formlayout.py", line 1097, in __init__
    self.formwidget.setup()
  File "C:\Python\formlayout\formlayout.py", line 644, in setup
    object_pairs_hook=OrderedDict)
  File "C:\WinPython-64bit-3.5.2.1Qt5\python-3.5.2.amd64\lib\json\__init__.py", line 268, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "C:\WinPython-64bit-3.5.2.1Qt5\python-3.5.2.amd64\lib\json\__init__.py", line 332, in loads
    return cls(**kw).decode(s)
  File "C:\WinPython-64bit-3.5.2.1Qt5\python-3.5.2.amd64\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\WinPython-64bit-3.5.2.1Qt5\python-3.5.2.amd64\lib\json\decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@lesteve
Copy link
Copy Markdown
Collaborator

lesteve commented Aug 4, 2016

We could set-up AppVeyor to test on Windows. I'll try to look at it next week at one point.

@fgallaire
Copy link
Copy Markdown
Collaborator Author

fgallaire commented Aug 17, 2016

New fix, tests welcome!

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

Successfully merging this pull request may close these issues.

3 participants