When resolving git-lfs references, json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
See original GitHub issueWe are unable to access attck.enterprise.actors, attck.enterprise.techniques, etc because the code is downloading a json file that is actually a git-lfs reference and not valid json.
It fails when parsing the output of https://github.com/swimlane/pyattck/blob/master/attck_to_nist_controls.json?raw=True.
We are using version 3.0.1.
Reproduction below:
Python 3.8.6 (default, Jan 8 2021, 15:34:15)
[Clang 12.0.0 (clang-1200.0.26.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyattck import Attck
>>> attck = Attck()
>>> attck.enterprise.actors
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/blah/lib/python3.8/site-packages/pyattck/attck.py", line 224, in enterprise
self.__load_data()
File "/blah/lib/python3.8/site-packages/pyattck/attck.py", line 285, in __load_data
Attck.__ENTERPRISE_NIST_DATA_JSON = self.__datasets.get_data(
File "/blah/lib/python3.8/site-packages/pyattck/datasets.py", line 66, in get_data
return self.__get_json_data(
File "/blah/lib/python3.8/site-packages/pyattck/datasets.py", line 48, in __get_json_data
data = requests.get(url).json()
File "/blah/lib/python3.8/site-packages/requests/models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "/blah/.pyenv/versions/3.8.6/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/blah/.pyenv/versions/3.8.6/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/blah/.pyenv/versions/3.8.6/lib/python3.8/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 1 (char 0)
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
JSONDecodeError: Expecting value: line 1 column 1 (char 0 ...
I still have the same problem after git lfs fetch successful. The problem is because of this following line: img = Image(imageName) ...
Read more >JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The following is the code I use for the curl request. The error happens at return simplejson.loads(response_json) response_json = self.web_fetch ...
Read more >Expecting Value: Line 1 column 1 (char 0) - Python Pool
JSONDecodeError means there is an incorrect JSON format being followed. For instance, the JSON data may be missing a curly bracket, have a...
Read more >Fix: json.decoder.jsondecodeerror: expecting value: line 1 ...
If you're working with APIs and trying to fetch or parse JSON data during HTTP or CURL requests, getting a properly formatted JSON...
Read more >Git LFS Repositories - JFrog
One solution for all binaries: Once you are using Artifactory to store media assets there is no need to use a 3rd party...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@amirjalali65 @jbraswell Please checkout the new release which resolves this issue and adds much better handling of configuration going forward.
I was using
3.0.0, bumping to3.0.1fixed the issue. Thanks