[Solved] [Bug] [Windows] Hole tool fails with special characters in the username

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Haavard
Posts: 217
Joined: Wed Feb 17, 2021 10:48 pm

[Solved] [Bug] [Windows] Hole tool fails with special characters in the username

Post by Haavard »

The Hole tool fails to read DIN/ISO resource files on Windows if you have special non-7bit-ascii characters in your username (i think).
This is on a fresh install with a clean config-file.

Possibly related: https://forum.freecadweb.org/viewtopic.php?f=3&t=69825

Code: Select all

09:05:03  Failed reading 'C:/Users/SpecialUsernameÆÅØ/AppData/Local/Programs/FreeCAD 0.20/data/Mod/PartDesign/Resources/Hole/din7984.json' with: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
09:05:03  Failed reading 'C:/Users/SpecialUsernameÆÅØ/AppData/Local/Programs/FreeCAD 0.20/data/Mod/PartDesign/Resources/Hole/iso10642-fine.json' with: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
09:05:03  Failed reading 'C:/Users/SpecialUsernameÆÅØ/AppData/Local/Programs/FreeCAD 0.20/data/Mod/PartDesign/Resources/Hole/iso10642.json' with: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
09:05:03  Failed reading 'C:/Users/SpecialUsernameÆÅØ/AppData/Local/Programs/FreeCAD 0.20/data/Mod/PartDesign/Resources/Hole/iso12474-fine.json' with: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
09:05:03  Failed reading 'C:/Users/SpecialUsernameÆÅØ/AppData/Local/Programs/FreeCAD 0.20/data/Mod/PartDesign/Resources/Hole/iso14583.json' with: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
09:05:03  Failed reading 'C:/Users/SpecialUsernameÆÅØ/AppData/Local/Programs/FreeCAD 0.20/data/Mod/PartDesign/Resources/Hole/iso14583part.json' with: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
09:05:03  Failed reading 'C:/Users/SpecialUsernameÆÅØ/AppData/Local/Programs/FreeCAD 0.20/data/Mod/PartDesign/Resources/Hole/iso2009.json' with: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
09:05:03  Failed reading 'C:/Users/SpecialUsernameÆÅØ/AppData/Local/Programs/FreeCAD 0.20/data/Mod/PartDesign/Resources/Hole/iso4762-fine.json' with: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
09:05:03  Failed reading 'C:/Users/SpecialUsernameÆÅØ/AppData/Local/Programs/FreeCAD 0.20/data/Mod/PartDesign/Resources/Hole/iso4762.json' with: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
09:05:03  Failed reading 'C:/Users/SpecialUsernameÆÅØ/AppData/Local/Programs/FreeCAD 0.20/data/Mod/PartDesign/Resources/Hole/iso4762_7089.json' with: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
09:05:03  Failed reading 'C:/Users/SpecialUsernameÆÅØ/AppData/Local/Programs/FreeCAD 0.20/data/Mod/PartDesign/Resources/Hole/iso7046.json' with: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: Norwegian Bokmal/Norway (nb_NO)
Last edited by Haavard on Sun Aug 21, 2022 9:40 am, edited 1 time in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Bug] [Windows] Hole tool fails with special characters in the username

Post by Kunda1 »

Can you rename 'SpecialUsernameÆÅØ' and check?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Haavard
Posts: 217
Joined: Wed Feb 17, 2021 10:48 pm

Re: [Bug] [Windows] Hole tool fails with special characters in the username

Post by Haavard »

I created two new local users, "freecad" and "freecadÆØÅ". Installed 0.20.1 in both accounts, and only "freecadÆØÅ" reported this bug.

@wmayer fixed this issue in techdraw, and searching for std::ifstream in src/Mod/PartDesign/App/FeatureHole.cpp i think line 2298 might be to blame.

I created a pull request with a possible fix, but i am not able to compile on windows atm, so cannot test it personally.
Haavard
Posts: 217
Joined: Wed Feb 17, 2021 10:48 pm

Re: [Solved] [Bug] [Windows] Hole tool fails with special characters in the username

Post by Haavard »

wmayer wrote: Sun Aug 21, 2022 10:47 am More fixes in git commit 5014bab534
Awesome, much appreciated! :)
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Solved] [Bug] [Windows] Hole tool fails with special characters in the username

Post by Kunda1 »

@Haavard congrats on your first PR!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Haavard
Posts: 217
Joined: Wed Feb 17, 2021 10:48 pm

Re: [Solved] [Bug] [Windows] Hole tool fails with special characters in the username

Post by Haavard »

Kunda1 wrote: Sun Aug 21, 2022 2:47 pm @Haavard congrats on your first PR!
Thanks :)
Post Reply