Python 3.8.1 - UTF-8 support missing

Need help, or want to share a macro? Post here!
User avatar
FBXL5
Posts: 41
Joined: Sat Aug 03, 2019 8:45 pm

Python 3.8.1 - UTF-8 support missing

Postby FBXL5 » Wed Jan 22, 2020 7:49 am

Hello community,

I wondered that I wasn't able to run several scripts anymore, and discovered that Python shifted from version 3.7.x to version 3.8.1.
Error message states something like:
During initialization the error "'ascii' codec can't decode byte 0xc3 in position 50: ordinal not in range(128)" occurred in /Users/.../FreeCAD_019-19310-py381.app/Contents/Resources/Mod/ReverseEngineering/InitGui.py

(In this case the umlaut "ü" of Jürgen Riegels copyright statement is the problem: "(c) 2003 Jürgen Riegel")

Is there any easy way to get Python 3.8.1 of this distribution to work with UTF-8 instead just ASCII?

Looking forward to an easy solution or the next FreeCAD version with UTF-8-enabled Python 3.8.1,
Kay

OS: macOS 10.15
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19323 (Git)
Build type: Release
Branch: master
Hash: 1b198453b8eb6aa2eaca4e4be4b49fee74e9de6e
Python version: 3.8.1
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)
chrisb
Posts: 22360
Joined: Tue Mar 17, 2015 9:14 am

Re: Python 3.8.1 - UTF-8 support missing

Postby chrisb » Wed Jan 22, 2020 8:55 am

See https://forum.freecadweb.org/viewtopic.php?f=3&t=42613. Adding
# -*- coding: utf-8 -*-
did not help.
User avatar
easyw-fc
Posts: 2797
Joined: Thu Jul 09, 2015 9:34 am

Re: Python 3.8.1 - UTF-8 support missing

Postby easyw-fc » Wed Jan 22, 2020 9:23 am

FBXL5 wrote:
Wed Jan 22, 2020 7:49 am
OS: macOS 10.15
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19323 (Git)
Build type: Release
Branch: master
Hash: 1b198453b8eb6aa2eaca4e4be4b49fee74e9de6e
Python version: 3.8.1
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)
a bit out of topic... but OSX is already on OCC 7.4?
What about Win and Linux?
User avatar
microelly2
Posts: 4625
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Python 3.8.1 - UTF-8 support missing

Postby microelly2 » Wed Jan 22, 2020 9:56 am

It looks like there is a version of FreeCAD with python 3.8.1 on MacOs.
This version makes some trouble
I got a error for pyflow too (time.clock()): https://forum.freecadweb.org/viewtopic. ... 60#p361244

To check all effects it makes sense to have a FreeCAD version running with python 3.8.1 in general.
UR_
Posts: 1171
Joined: Tue Jan 03, 2017 8:42 pm

Re: Python 3.8.1 - UTF-8 support missing

Postby UR_ » Wed Jan 22, 2020 10:28 am

chrisb
Posts: 22360
Joined: Tue Mar 17, 2015 9:14 am

Re: Python 3.8.1 - UTF-8 support missing

Postby chrisb » Wed Jan 22, 2020 7:53 pm

easyw-fc wrote:
Wed Jan 22, 2020 9:23 am
a bit out of topic... but OSX is already on OCC 7.4?
Yes, OCC 7.4.0 and Python 3.8.1.
User avatar
FBXL5
Posts: 41
Joined: Sat Aug 03, 2019 8:45 pm

Re: Python 3.8.1 - UTF-8 support missing

Postby FBXL5 » Wed Jan 22, 2020 8:08 pm

# -*- coding: utf-8 -*-
doesn't work for me either.

Editing the ...GUI.py files and eliminating the non-ascii characters is just a solution for a few days, until the next build is installed.
User avatar
looo
Posts: 3175
Joined: Mon Nov 11, 2013 5:29 pm

Re: Python 3.8.1 - UTF-8 support missing

Postby looo » Wed Jan 22, 2020 9:15 pm

microelly2 wrote:
Wed Jan 22, 2020 9:56 am
I got a error for pyflow too (time.clock()): https://forum.freecadweb.org/viewtopic. ... 60#p361244
you can use clock.process_time() for py3 but this doesn't work in py2:
https://github.com/FreeCAD/FreeCAD/comm ... 085e73f01e

I have no idea about the unicode problem. This seems to be only existing in the py3.8 / osx version. But I can't find any other issues reported so far.
please help with my conda-packaging efforts: https://liberapay.com/looooo/
minimalistic blog: https://looooo.github.io/mini-blog/
User avatar
microelly2
Posts: 4625
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Python 3.8.1 - UTF-8 support missing

Postby microelly2 » Wed Jan 22, 2020 9:16 pm

There was a change some days ago from ue to ü
https://github.com/FreeCAD/FreeCAD/comm ... 54371529bf