Remix.run Logo
ruuda a day ago

> Python now uses UTF-8 as the default encoding, independent of the system’s environment.

Nice, not specifying the encoding is one of the most common issues I need to point out in code reviews.

franga2000 a day ago | parent | next [-]

You mean the coding= comment? Where are you shipping your code that that was actually a problem? I've never been on a project where we did that, let alone needed it.

KORraN a day ago | parent [-]

The comment you mention applies to source code encoding and it's obsolete for Python 3 since the beginning. This is about something else: https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-...

franga2000 a day ago | parent [-]

Makes sense, my bad, but even that is something I've never seen. I guess this is mostly a Windows thing? I've luckily never had the misfortune of having to deploy Python code on Windows.

joshribakoff a day ago | parent | prev | next [-]

Have you considered reducing review noise by using static analysis?

KK7NIL a day ago | parent [-]

Yep, ruff has a warning for this exact issue.

IshKebab a day ago | parent [-]

Pylint has had it too for at least a decade.

simon04 21 hours ago | parent [-]

Ruff's rule is derived from Pylint: https://docs.astral.sh/ruff/rules/unspecified-encoding/

formerly_proven a day ago | parent | prev [-]

encode()/decode() have used UTF-8 as the default since Python 3.2 (soon, 15 years ago). This is about the default encoding for e.g. the "encoding" parameter of open().