-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[BUG] UnicodeEncodeError on Windows with ruler. #2411
Comments
Not the first time we've been bitten by Windows CP-1252 encoding. The solution may be to force utf8 |
I can't reproduce this. Running the same Python version, Rich version, tried legacy/non-legacy terminals, tried forcing the encoding to cp1252 and utf-8, tried with an without running in a subprocess. Every time the rule renders without an error. I'm not sure where else the difference could lie 🤔 It's interesting that you've supplied the example as a subprocess - is that because you can only reproduce the issue when you run it in a subprocess? I noticed in the "Platform" information you shared, Also, comparing the version that works with you with the latest version, I can't see any relevant (encoding-related) changes at all: v12.4.4...v12.5.1 |
Yes, this error only occurs when I am using pytest to execute the subprocess script with |
I also had it after an update in my windows tests in github I am using |
For tests, you probably want to set |
Did I solve your problem? Why not buy the devs a coffee to say thanks? |
I am seeing this in a azure pipelines run of a conda-forge feedstock. Should I open another issue? Relevant bits: Python 3.8, rich 12.6.0-pyhd8ed1ab_0 from conda-forge. ConsoleOptionsFrom this log
when rendering this string
|
This is still an issue. In CP1252 encoding (which is what the :! operator in nvim uses) console.print(Rule()) and console.rule() throw an error when no title is provided. They work fine with a title provided. |
Describe the bug
The issue started appearing in my test suite, and I could boil it down to this reproducible example. I am using rich 12.5.1.
and then I am executing
pytest run.py
, which results inClick to expand
The error does not occur when I
python run.py
Platform
Click to expand
The issue occurred only on Windows and I am running Powershell Core embedded in Windows Terminal.
The text was updated successfully, but these errors were encountered: