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

[Python console] prevent crash #7323

Closed
wants to merge 1 commit into from

Conversation

mwganson
Copy link
Contributor

@mwganson mwganson commented Aug 6, 2022

Forum topic: https://forum.freecadweb.org/viewtopic.php?f=8&t=70732

Crash occurs when pasting the following into the python console:

if True:
    print('ß')
    print('ß')

There might be a better way to fix the issue, which seems almost certainly related to the use of non-ASCII characters.

@github-actions github-actions bot added the Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD label Aug 6, 2022
@berndhahnebach
Copy link
Contributor

pipeline status for feature branch PR_7323. Pipeline 606464892 was triggered at 99b42a5. All CI branches and pipelines.

@donovaly donovaly added the 0.20.1 label Aug 6, 2022
@donovaly
Copy link
Member

donovaly commented Aug 6, 2022

@wwmayer , I would like to have this in for 0.20.1. It looks straight forward, but you might want to have a look if more needs to be done.

@al-right
Copy link

al-right commented Aug 7, 2022

I am really not into the code base, but maybe this is of some help:
Could the toLatin1() that mfro mentions in:
https://forum.freecadweb.org/viewtopic.php?p=615500#p615500
, be related to back when FreeCAD used Python 2 prior to version 0.19?

Python 3 uses UTF-8 as default: https://peps.python.org/pep-3120/
Again - I am just guessing. Thanks :)

@wwmayer
Copy link
Contributor

wwmayer commented Aug 7, 2022

Fixes the crash and the UTF-8 issue: c4547c0
@donovaly The change should be backported

@wwmayer wwmayer closed this Aug 7, 2022
@donovaly
Copy link
Member

donovaly commented Aug 7, 2022

Thanks!
Backported.

@mwganson mwganson deleted the console_crashfix branch November 13, 2023 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants