Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ruff detects E902 when using special character in code #11876

Closed
quebt opened this issue Jun 14, 2024 · 5 comments
Closed

ruff detects E902 when using special character in code #11876

quebt opened this issue Jun 14, 2024 · 5 comments

Comments

@quebt
Copy link

quebt commented Jun 14, 2024

  • Keywords: utf-8, E902
  • script example. Use § or ü in a string to trigger the bug.
import os

test = 'abc§'
print(os.getcwd())
    print('wrong indent')
  • ruff settings non special simply
    ruff check .\test.py

  • version 0.4.8

  • Output. Here interesting: the syntax bug is not reported, instead ruff stops.
    image

@MichaReiser
Copy link
Member

MichaReiser commented Jun 14, 2024

Can you try changing the encoding to UTF8 in the bottom-toolbar (click Windows-1252). Ruff only supports UTF8 encoded files.

Related issue: #6791

@quebt
Copy link
Author

quebt commented Jun 17, 2024

ok, that did the trick. but what about other encodings? we have a system which does not support python code in utf-8...

@MichaReiser
Copy link
Member

Ruff doesn't support other encodings today. Can you tell us more about your system that doesn't support utf8? What python version are you using?

@quebt
Copy link
Author

quebt commented Jun 22, 2024

Hi,
It is a trading system from FIS. Actually it does support utf-8 but since there are scripts from the vendor in non utf-8 we habe sometimes no choice. Currently we are on Python 3.7.9 but we are upgrading to 3.9.18.

@charliermarsh
Copy link
Member

I'm going to call this unsupported but happy to hear more about your use-case and whether we can help with it in ways other than supporting alternate encodings.

@charliermarsh charliermarsh closed this as not planned Won't fix, can't repro, duplicate, stale Jun 23, 2024
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

No branches or pull requests

3 participants