-
Notifications
You must be signed in to change notification settings - Fork 23
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
Decoding issue #18
Comments
I am having the same issue. I also am having issues when parsing Docuemnts that have Collection within them. |
I have been fidgeting with a little and sortof found a solution. I change the def serialize_json(obj):
try:
if isinstance(obj, datetime.datetime):
if obj.utcoffset() is not None:
obj = obj - obj.utcoffset()
millis = int(calendar.timegm(obj.timetuple()) * 1000 + obj.microsecond / 1000)
return millis
return str(obj)
except UnicodeDecodeError:
return obj.decode("utf-8", errors="ignore") the old code looked like this: def serialize_json(obj):
if isinstance(obj, datetime.datetime):
if obj.utcoffset() is not None:
obj = obj - obj.utcoffset()
millis = int(calendar.timegm(obj.timetuple()) * 1000 + obj.microsecond / 1000)
return millis
return str(obj) This fixes the error or morso bypasses the problem, but there are still parts that don't work. When it runs over a list of objects, it seems unable to parse it properly and the list becomes a jumble of unicode escape sequences. I don't know if this helps, but it will allow you to run the program without any errors. |
Hello,
I'm running
python fs_to_json.py ../2024-08-27T13:49:35_42810/all_namespaces/all_kinds/ out
where../2024-08-27T13:49:35_42810/all_namespaces/all_kinds/
isThe conversion worked for 9 files but created 12 empty JSON files. Is this a known bug and are there any tips on how to resolve?
The text was updated successfully, but these errors were encountered: