Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange JSON decoding problem at 1MB mark on line #21

Open
stucka opened this issue Jul 17, 2024 · 1 comment
Open

Strange JSON decoding problem at 1MB mark on line #21

stucka opened this issue Jul 17, 2024 · 1 comment

Comments

@stucka
Copy link

stucka commented Jul 17, 2024

I'm using Python 3.10.6 on Windows and am getting a strange little JSON decoding problem that's curiously right at the 1mb mark, so I'm inclined to think there's a character limitation somewhere.

Traceback (most recent call last):
  File "C:\Python\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python\Scripts\har2requests.exe\__main__.py", line 7, in <module>
  File "C:\Python\lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "C:\Python\lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "C:\Python\lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Python\lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "C:\Python\lib\site-packages\har2requests\__init__.py", line 136, in main
    request = Request.from_json(
  File "C:\Python\lib\site-packages\har2requests\request.py", line 69, in from_json
    responseData = json.loads(responseText)
  File "C:\Python\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Python\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Python\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1048575 (char 1048574)

Looks like farther down Firefox broke the export, too:

{\"Value\":false,\"CanBeChanged\":tru"
          },
@louisabraham
Copy link
Owner

Hello!

What do you mean by "Firefox broke the export"?

Do you have a way to look at the JSON that Python is trying to decode?

I don't think Python has trouble with long JSON, so it's probably the data we are putting in that is corrupted.

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

No branches or pull requests

2 participants