Can you tell me whether, after attempting the installation, the directory "C:\Users\HåvardJakobsen\AppData\Roaming\FreeCAD\Mod\Assembly4" exists? I'm trying to figure out whether the problem is in the unzip code or the metadata code.
Is this stilll correct?: Don't use special characters in your windows user name
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
Re: Is this stilll correct?: Don't use special characters in your windows user name
Re: Is this stilll correct?: Don't use special characters in your windows user name
This is a Windows-only problem because a UTF-8 encoded file path is not encoded as UTF-16 (wide string) when passing it to boost::file_system::path.
It can be easily tested without creating an account with special characters. Just create the directory C:\Temp\HåvardJakobsen and put a valid package.xml into it. Now run this Python code:
Code: Select all
App.Metadata(r"C:\Temp\HåvardJakobsen\package.xml")
Traceback (most recent call last):
File "<input>", line 1, in <module>
Base.XMLBaseException: Fatal error at file "", line 0, column 0
Message: unable to open primary document entity 'C:\Temp\HåvardJakobsen\package.xml
Re: Is this stilll correct?: Don't use special characters in your windows user name
I deleted all AppData folders and this is the result:
After opening and closing fc the default FreeCAD folder is created as expected:
After pressing install on Assy4, the Mod\Assembly4 folder is created, so the unzip parts should work correctly. I compared the sha256 of all files in this folder to the git archive, and it matches.
Re: Is this stilll correct?: Don't use special characters in your windows user name
git commit 22829f8a24 fixes the utf-8 / utf-16 conversion of the file path so that Metadata can load the XML file. It still needs to be tested if this also fixes all issues with the AddonManager if the user name includes special characters.
EDIT: I have added the commit to the list of backports: https://forum.freecadweb.org/viewtopic. ... 06#p602206
EDIT: I have added the commit to the list of backports: https://forum.freecadweb.org/viewtopic. ... 06#p602206
Re: Is this stilll correct?: Don't use special characters in your windows user name
I have added a unit test to check file paths (git commit 448b1ec9f38077). After fixing the actual issue with MetadataPy the unit tests pass on my local machines (Windows/Linux) but for some reason the CI tests on Gitlab fail. The error is:
Neither setting the encoding to utf-8 nor using the codecs module to open the file works.
Anyone has an idea why this happens and how to fix it? I thought with Py3 all this kind of issues should have gone.
Code: Select all
Traceback (most recent call last):
File "/builds/freecad/FreeCAD-CI/build/Mod/Test/Metadata.py", line 114, in test_file_path
xmlfile = open(file=filename, mode="w", encoding="utf-8")
UnicodeEncodeError: 'ascii' codec can't encode character '\xe5' in position 6: ordinal not in range(128)
Anyone has an idea why this happens and how to fix it? I thought with Py3 all this kind of issues should have gone.
Re: Is this stilll correct?: Don't use special characters in your windows user name
Hi
over 127 my "cauchemar"
App.Metadata(r"C:\\Temp\\HåvardJakobsen\\package.xml")
App.Metadata(r"C:\\Temp\\HavardJakobsen\\package.xml")
the content .xml (good or not good ? if not good give one good .xml file)
FC info
mario
over 127 my "cauchemar"
App.Metadata(r"C:\\Temp\\HåvardJakobsen\\package.xml")
Code: Select all
>>> App.Metadata(r"C:\\Temp\\HåvardJakobsen\\package.xml")
Traceback (most recent call last):
File "<input>", line 1, in <module>
Base.XMLBaseException: Fatal error at file "", line 0, column 0
Message: unable to open primary document entity 'C:\\Temp\\HåvardJakobsen\\package.xml'
Code: Select all
>>> App.Metadata(r"C:\\Temp\\HavardJakobsen\\package.xml")
Traceback (most recent call last):
File "<input>", line 1, in <module>
Base.XMLBaseException: package.xml format version is not supported by this version of FreeCAD
>>>
Code: Select all
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<package format="2" xmlns="https://wiki.freecad.org/Package_Metadata">
<name>Bad format</name>
<description>There is no such thing as format version 2 (yet).</description>
<version>1.0.0</version>
</package>
Code: Select all
OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.21.29283 (Git)
Build type: Release
Branch: master
Hash: 15e3e86c5a683f3b2e5c7b95d4b26cd719ab367a
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
Re: Is this stilll correct?: Don't use special characters in your windows user name
That XML file is one of my "bad" example files from the test suite -- you are getting the correct error for it when you use the plain ASCII username. Is that with @wmayer's latest code, or an earlier version?
Re: Is this stilll correct?: Don't use special characters in your windows user name
Hi
.xml same content
version FC for the 2 tests
mario
.xml same content
version FC for the 2 tests
Code: Select all
OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.21.29283 (Git)
Build type: Release
Branch: master
Hash: 15e3e86c5a683f3b2e5c7b95d4b26cd719ab367a
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
Re: Is this stilll correct?: Don't use special characters in your windows user name
Hi
I have the same problem with my username - António- in my instalation of Assembly4 it was installed in C:\Users\António\AppData\Roaming\FreeCAD\Mod\Assembly4 it changed ó with ó.
I have another problem but don't know if they're related, when i try to do a dimensional constraint using the formula editor with <<movel1>>#<<Spreadsheet>>.grossuraazulejo it gives an error
---------------------------
Dimensional constraint
---------------------------
Failed to convert to Quantity
in property binding 'lateral_direita#Sketch001.Constraints'
---------------------------
OK
-------------------------
My FC
I have the same problem with my username - António- in my instalation of Assembly4 it was installed in C:\Users\António\AppData\Roaming\FreeCAD\Mod\Assembly4 it changed ó with ó.
I have another problem but don't know if they're related, when i try to do a dimensional constraint using the formula editor with <<movel1>>#<<Spreadsheet>>.grossuraazulejo it gives an error
---------------------------
Dimensional constraint
---------------------------
Failed to convert to Quantity
in property binding 'lateral_direita#Sketch001.Constraints'
---------------------------
OK
-------------------------
My FC
Code: Select all
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.2
Locale: Portuguese/Portugal (pt_PT)
Installed mods:
* Assembly4 0.12.0
Re: Is this stilll correct?: Don't use special characters in your windows user name
This is very unlikely to be related. Please open a new topic in the 'Help' subforum and attach your file there.