UnicodeDecodeError

Issue #2215 open
multibit soft created an issue

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 91124882: invalid start byte
Location: C:\Program Files\Blender Foundation\Blender 4.2\4.2\scripts\modules\bpy\ops.py:109

I'm trying to export the boat

Comments (9)

  1. Midnight Arrow

    It looks like it’s trying to read a DSON file as if it were uncompressed, but it found a Gzip magic number instead and doesn’t know what to do.

    @Padone That’s the location of the Python interpreter that the addon calls into.

  2. Thomas Larsson repo owner

    It is hard to understand why a decode error should arise if you are trying to export something. But it is impossible to guess without context. Could you upload the entire python error.

  3. multibit soft reporter
    Fitting objects with dbz file...
    Traceback (most recent call last):
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\error.py", line 225, in execute
        self.run(context)
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\main.py", line 302, in run
        self.loadDazFile(filepath, context)
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\main.py", line 145, in loadDazFile
        fitToFile(filepath, main.nodes)
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\dbzfile.py", line 333, in fitToFile
        dbz = loadDbzFile(filepath)
              ^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\dbzfile.py", line 182, in loadDbzFile
        struct = loadJson(filepath)
                 ^^^^^^^^^^^^^^^^^^
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\load_json.py", line 122, in loadJson
        string = bytes.decode("utf-8-sig")
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Blender Foundation\Blender 4.2\4.2\python\Lib\encodings\utf_8_sig.py", line 23, in decode
        (output, consumed) = codecs.utf_8_decode(input, errors, True)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 91124882: invalid start byte
    Error: Python: Traceback (most recent call last):
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\error.py", line 225, in execute
        self.run(context)
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\main.py", line 302, in run
        self.loadDazFile(filepath, context)
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\main.py", line 145, in loadDazFile
        fitToFile(filepath, main.nodes)
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\dbzfile.py", line 333, in fitToFile
        dbz = loadDbzFile(filepath)
              ^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\dbzfile.py", line 182, in loadDbzFile
        struct = loadJson(filepath)
                 ^^^^^^^^^^^^^^^^^^
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scriptTraceback (most recent call last):
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\error.py", line 225, in execute
        self.run(context)
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\main.py", line 772, in run
        self.easyImport(context)
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\main.py", line 784, in easyImport
        bpy.ops.daz.import_daz_manually(
      File "C:\Program Files\Blender Foundation\Blender 4.2\4.2\scripts\modules\bpy\ops.py", line 109, in __call__
        ret = _op_call(self.idname_py(), kw)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    RuntimeError: Error: Python: Traceback (most recent call last):
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\error.py", line 225, in execute
        self.run(context)
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\main.py", line 302, in run
        self.loadDazFile(filepath, context)
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\main.py", line 145, in loadDazFile
        fitToFile(filepath, main.nodes)
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\dbzfile.py", line 333, in fitToFile
        dbz = loadDbzFile(filepath)
              ^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\dbzfile.py", line 182, in loadDbzFile
        struct = loadJson(filepath)
                 ^^^^^^^^^^^^^^^^^^
      File "C:\Users\hunte\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\import_daz\load_json.py", line 122, in loadJson
        string = bytes.decode("utf-8-sig")
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Blender Foundation\Blender 4.2\4.2\python\Lib\encodings\utf_8_sig.py", line 23, in decode
        (output, consumed) = codecs.utf_8_decode(input, errors, True)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 91124882: invalid start byte
    Location: C:\Program Files\Blender Foundation\Blender 4.2\4.2\scripts\modules\bpy\ops.py:109
    

  4. multibit soft reporter

    and untick everything in daz setup

    for example Merge Material ..

    and global setting is only Root Path

  5. Thomas Larsson repo owner

    This means that the dbz file is corrupt in some way. I can see three reasons for this:

    1. There was some glitch when the file was exported, like the DS session was halted in the middle of writing the file. Try again.
    2. The dbz file contains some non-latin letters. However, I think that was fixed in #253. I downloaded the files in that issue, opened them in DS and exported the dbz file, and imported into Blender. No issues, and the imported objects are properly labelled in Russian, Greek and Japanese. The dbz files are ascii files in this case, because the DS implementation of gzip has problems with unicode.
    3. You were making a HD export of objects with high mesh resolution, typically >= 5. Then DS runs into memory problems and simply truncates the dbz file.

  6. Log in to comment