ParthJadhav / Tkinter-Designer

An easy and fast way to create a Python GUI 🐍
BSD 3-Clause "New" or "Revised" License
8.87k stars 817 forks source link

json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 4175618 (char 4175617) #220

Open Tylersuard opened 2 years ago

Tylersuard commented 2 years ago

Traceback (most recent call last): File "C:\Users\tyler\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\tyler\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\tyler\AppData\Local\Programs\Python\Python38\Scripts\tkdesigner.exe__main.py", line 7, in File "C:\Users\tyler\AppData\Local\Programs\Python\Python38\lib\site-packages\tkdesigner\cli.py", line 70, in main designer = Designer(token, file_key, output_path) File "C:\Users\tyler\AppData\Local\Programs\Python\Python38\lib\site-packages\tkdesigner\designer.py", line 16, in init
self.file_data = self.figma_file.get_file() File "C:\Users\tyler\AppData\Local\Programs\Python\Python38\lib\site-packages\tkdesigner\figma\endpoints.py", line 32, in get_file return response.json() File "C:\Users\tyler\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\models.py", line 900, in json return complexjson.loads(self.text, **kwargs) File "C:\Users\tyler\AppData\Local\Programs\Python\Python38\lib\json\
init__.py", line 357, in loads return _default_decoder.decode(s) File "C:\Users\tyler\AppData\Local\Programs\Python\Python38\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\tyler\AppData\Local\Programs\Python\Python38\lib\json\decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 4175618 (char 4175617)

Tylersuard commented 2 years ago

This happens when trying to run the tkdesigner URL token command, used pip install, windows machine

Tylersuard commented 2 years ago

I think it has to do with the format of whatever is coming in from the request. Python is having a hard time converting it into JSON format.

Tylersuard commented 2 years ago

Ok, I wrote the response.text out to a file then validated the JSON using an online tool. Then I loaded it back into the program, it worked. It looks nothing like the original though, because no rounded edges.

pshiri commented 2 years ago

Facing the same issue here

ParthJadhav commented 2 years ago

Hey @Tylersuard & @pshiri can you share your Figma file links ? There was a bug in Figma API which would return incomplete JSON. Need to verify if true.