Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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