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

PR: Always use utf-8 when handling QByteArray data in ProcessWorker (Utils) #22656

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

ccordoba12
Copy link
Member

Description of Changes

  • It seems the previous approach (using the Windows code page) was necessary to have compatibility with Python 2.
  • That was affecting opening project files in our switcher with the help of fzf.

Issue(s) Resolved

Fixes #22546.

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct:

@ccordoba12
Copy link
Member Author

@dalthviz, could you check that our fzf support works in a project directory that has Chinese and/or Arabic characters in its name? Thanks!

@ccordoba12 ccordoba12 changed the title Utils: Always use utf-8 when handling QByteArray data in ProcessWorker PR: Always use utf-8 when handling QByteArray data in ProcessWorker (Utils) Oct 9, 2024
@dalthviz
Copy link
Member

@dalthviz, could you check that our fzf support works in a project directory that has Chinese and/or Arabic characters in its name? Thanks!

Checked using Spyder 6.0.1 from the Windows installer and also this PR with a project called test_project_项目 and seems to me that things with fzf work in both cases 🤔

Copy link
Member

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ccordoba12 ! Left a comment related with that maybe it could be worthy to add some sort of context of why now the function should always return utf-8. Also, maybe is worthy to add some sort of test for this? I'm unsure what is needed to reproduce the issue this fixes but probably having a test should ensure the change done here is enough

spyder/utils/workers.py Show resolved Hide resolved
@ccordoba12
Copy link
Member Author

Checked using Spyder 6.0.1 from the Windows installer and also this PR with a project called test_project_项目 and seems to me that things with fzf work in both cases 🤔

Ok, thanks for checking @dalthviz. Maybe the problem only appears for computers with a proper Windows Chinese version. In any case, the user that reported issue #22546 verified that this correctly fixes it for them.

Copy link
Member

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ccordoba12 !

@dalthviz dalthviz merged commit 3274e79 into spyder-ide:master Oct 21, 2024
17 checks passed
@dalthviz
Copy link
Member

@meeseeksdev please backport to 6.x

meeseeksmachine pushed a commit to meeseeksmachine/spyder that referenced this pull request Oct 21, 2024
…yteArray data in `ProcessWorker` (Utils)
@ccordoba12 ccordoba12 deleted the issue-22546 branch October 21, 2024 23:56
dalthviz added a commit that referenced this pull request Oct 22, 2024
…656-on-6.x

Backport PR #22656 on branch 6.x (PR: Always use `utf-8` when handling QByteArray data in `ProcessWorker` (Utils))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UnicodeDecodeError when changing files with an open project
2 participants