Part.makeWireString issue with unicode file name

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Part.makeWireString issue with unicode file name

Post by Roy_043 »

In V0.21 Part.makeWireString can no longer handle a unicode character in the filename. The code below works in V0.20, but not in the mentioned V0.21 version.

Code: Select all

import Part
Part.makeWireString("abc", "D:\\FreeCAD\\PR0000-draft-decode\\FreeMonoé.ttf", 10, 0)

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.21.0.32457 (Git)
Build type: Release
Branch: master
Hash: 85216bd12730bbc4c3cbf8f0bc50416ab1556cbb
Python 3.10.9, Qt 5.15.8, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US) [ OS: Dutch/Netherlands (nl_NL) ]
Installed mods:
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Part.makeWireString issue with unicode file name

Post by Syres »

Roy_043 wrote: Tue Mar 28, 2023 12:51 pm In V0.21 Part.makeWireString can no longer handle a unicode character in the filename. The code below works in V0.20, but not in the mentioned V0.21 version.
I can completely confirm your findings on Windows using the latest LibPack build 32552 but on all 4 of my Linux builds (OCC 7.3.0, 7.6.3, 7.7.0 and 7.7.1) I can open and change the same file I was using as a test on Windows (with the folder changed to suit). So from initial findings, either platform specific or a packaging issue???

Code: Select all

OS: Linux Mint 20.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.21.0.32593 (Git)
Build type: Release
Branch: master
Hash: c26dc2e68534e96b2b5482afa8f414170df4e593
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, Vtk 7.1.1, OCC 7.7.1
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * Silk 1.0.0
  * A2plus 0.4.60k
  * CurvedShapes 1.0.4
  * MakerWorkbench 1.0.1
  * freecad.gears 1.0.0
  * Curves 0.6.8
  * PieMenu 1.2.4
  * toSketch 1.0.1
  * Plot 2022.4.17
  * AirPlaneDesign 0.4.0
  * fasteners 0.4.54
  * sheetmetal 0.2.63
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Part.makeWireString issue with unicode file name

Post by wandererfan »

Roy_043 wrote: Tue Mar 28, 2023 12:51 pm
I am not near my windows vm. Could you please try:

Code: Select all

import Part
Part.makeWireString("abc", "D:/FreeCAD/PR0000-draft-decode/FreeMonoé.ttf", 10, 0)
and let me know what happens? Thanks.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Part.makeWireString issue with unicode file name

Post by Roy_043 »

@Syres Thanks for testing.

@wandererfan The new path results in the same error.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Part.makeWireString issue with unicode file name

Post by wandererfan »

Roy_043 wrote: Tue Mar 28, 2023 5:17 pm The new path results in the same error.
I'm thinking it is one of these 2 commits:
ucs4 vs ucs2 in Py3.10: git commit 3b29cf18be
temp files on windows: git commit c318bc08cb

Probably the second one. I'll look into it.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Part.makeWireString issue with unicode file name

Post by wandererfan »

Roy_043 wrote: Tue Mar 28, 2023 12:51 pm
Should be fixed by git commit 7fa7cb7f0b22.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Part.makeWireString issue with unicode file name

Post by Roy_043 »

Thank you.
Post Reply