Tkinter-Designer icon indicating copy to clipboard operation
Tkinter-Designer copied to clipboard

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

Open Tylersuard opened this issue 3 years ago • 5 comments

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 avatar May 04 '22 23:05 Tylersuard

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

Tylersuard avatar May 04 '22 23:05 Tylersuard

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 avatar May 05 '22 00:05 Tylersuard

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.

Tylersuard avatar May 05 '22 02:05 Tylersuard

Facing the same issue here

pshiri avatar Jun 07 '22 23:06 pshiri

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.

ParthJadhav avatar Jun 09 '22 05:06 ParthJadhav