Skip to content

UnicodeDecodeError: during apstools.utils.json_import(file) #183

@prjemian

Description

@prjemian

while working on #177, console output:

In [22]: datasets = APS_utils.json_import("/home/mintadmin/Documents/eclipse/apstools/tests/bluesky_data.zip")
---------------------------------------------------------------------------
UnicodeDecodeError                        Traceback (most recent call last)
<ipython-input-22-dc3ace4b364a> in <module>()
----> 1 datasets = APS_utils.json_import("/home/mintadmin/Documents/eclipse/apstools/tests/bluesky_data.zip")

~/Apps/anaconda/envs/bluesky/lib/python3.6/site-packages/apstools/utils.py in json_import(filename, zipfilename)
    690     if zipfilename is None:
    691         with open(filename, "r") as fp:
--> 692             buf = fp.read()
    693             datasets = json.loads(buf)
    694     else:

~/Apps/anaconda/envs/bluesky/lib/python3.6/codecs.py in decode(self, input, final)
    319         # decode input (taking the buffer into account)
    320         data = self.buffer + input
--> 321         (result, consumed) = self._buffer_decode(data, self.errors, final)
    322         # keep undecoded input until the next call
    323         self.buffer = data[consumed:]

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8f in position 10: invalid start byte

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions