Skip to content

Fix: use encoding= keyword for open() in ccmx.py - #973

Open
ahjulstad wants to merge 1 commit into
eoyilmaz:developfrom
ahjulstad:fix/utf8-mode-ccmx
Open

Fix: use encoding= keyword for open() in ccmx.py#973
ahjulstad wants to merge 1 commit into
eoyilmaz:developfrom
ahjulstad:fix/utf8-mode-ccmx

Conversation

@ahjulstad

Copy link
Copy Markdown

Generated with AI assistance by goose (AAIF).

Problem

convert_devicecorrections_to_ccmx() in DisplayCAL/ccmx.py called open(path, "utf8") passing "utf8" as the file mode positional argument instead of as the encoding. On Python 3.14, which has stricter mode validation, this raises:

Error("File invalid.\ninvalid mode: 'utf8'")

This prevented importing iColorDisplay colorimeter corrections at startup.

Fix

Changed open(path, "utf8") to open(path, encoding="utf8").

Generated with AI assistance by goose (AAIF).

Changed open(path, "utf8") to open(path, encoding="utf8") in
convert_devicecorrections_to_ccmx(). The positional argument "utf8"
was being interpreted as the file mode, not the encoding. On Python 3.14
this raises a ValueError due to stricter mode validation.
@Wedge009

Copy link
Copy Markdown

Makes sense to me even if it's something rather trivial for LLM-assistance.

@ahjulstad

Copy link
Copy Markdown
Author

Makes sense to me even if it's something rather trivial for LLM-assistance.

I know, I just wanted to flag it.

@adyrosebrigg

Copy link
Copy Markdown

can confirm this, I was experiencing the UI giving me an error when trying to import the corrections and this change is what fixed it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants