Skip to content

Meet&solve problem: 'gbk' codec can't decode byte 0x80 in position 0 illegal multibyte sequence #53

@kinggary92

Description

@kinggary92

Problem happend when setting glass of New_Lens.add_surfacesetting as non-air values.
Last line of Error trace is like ''gbk' codec can't decode byte 0x80 in position 0 illegal multibyte sequence'.

I do not know if it is related to my installing pyyaml via pip. But it turns out that ~37 line in '\opticspy\ray_tracing\glass_function\refractiveIndex.py' use a weird non-utf-8 codec by default which does not match the targeted file '\opticspy\ray_tracing\glass_database\library.yaml'.

Solution: designate utf-8 codec like
f = open(os.path.join(self.referencePath, os.path.normpath("library.yml")), "r", encoding='utf-8') # winterbear

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions