LineGroup.csv is not readable

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
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!
RussG
Posts: 124
Joined: Wed Apr 27, 2022 11:27 pm

LineGroup.csv is not readable

Post by RussG »

Code: Select all

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git)
Build type: Release
Branch: (HEAD detached at 0.20)
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.9.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: C/Default (C)
Installed mods: 
  * fasteners 0.3.50

I'm getting error messages in Report View with both .20 and .19.

Line Group File: /Applications/FreeCAD.app/Contents/Resources/share/Mod/TechDraw/LineGroup/LineGroup.csv is not readable

It seems to happen with files in which I've used TechDraw and that would seem to make sense as the error message references Tech Draw. The path to the csv file shows in the TechDraw prefs and is correct and the csv file will open in apps that read text files (file attached). With some files I also seem to get the following error reported:

/Applications/FreeCAD.app/Contents/Resources/share/Mod/TechDraw/Patterns/simple.svg


Is there something I should do about these errors?

Thanks.
LineGroup.csv
(1.05 KiB) Downloaded 16 times
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: LineGroup.csv is not readable

Post by wandererfan »

RussG wrote: Sat Aug 06, 2022 6:55 pm Is there something I should do about these errors?
There was a fix for this just before v0.20 was released - git commit 2b0dd54fe7 / revision 29014. Maybe it doesn't work on mac?

What do you get if you type "App.getResourceDir()" in the python console?
RussG
Posts: 124
Joined: Wed Apr 27, 2022 11:27 pm

Re: LineGroup.csv is not readable

Post by RussG »

wandererfan wrote: Sun Aug 07, 2022 1:50 pm
RussG wrote: Sat Aug 06, 2022 6:55 pm Is there something I should do about these errors?
There was a fix for this just before v0.20 was released - git commit 2b0dd54fe7 / revision 29014. Maybe it doesn't work on mac?

What do you get if you type "App.getResourceDir()" in the python console?
I've never used python before so I don't know if I did it right, if there is a certain time I need to type what you said, like right after the error code is issued. So, I just typed it and the info returned was:
'/Applications/FreeCAD .20.app/Contents/Resources/share/'

What does that tell us?
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: LineGroup.csv is not readable

Post by wandererfan »

RussG wrote: Sun Aug 07, 2022 5:29 pm '/Applications/FreeCAD .20.app/Contents/Resources/share/'

What does that tell us?
The code looks for a default location at getResourceDir()/Mod/TechDraw//LineGroup/LineGroup.csv. If it is looking in '/Applications/FreeCAD .20.app/Contents/Resources/share/' instead of "/Applications/FreeCAD.app/Contents/Resources/share/" that might be the problem.

What is your preference setting in the Files section of the General tab for Line Group File? Is it the path with the ".20" or the one without it (or something else entirely)?

Does the path '/Applications/FreeCAD .20.app/Contents/Resources/share/' exist and does it have a line group file in it?
RussG
Posts: 124
Joined: Wed Apr 27, 2022 11:27 pm

Re: LineGroup.csv is not readable

Post by RussG »

wandererfan wrote: Sun Aug 07, 2022 6:36 pm
RussG wrote: Sun Aug 07, 2022 5:29 pm '/Applications/FreeCAD .20.app/Contents/Resources/share/'

What does that tell us?
The code looks for a default location at getResourceDir()/Mod/TechDraw//LineGroup/LineGroup.csv. If it is looking in '/Applications/FreeCAD .20.app/Contents/Resources/share/' instead of "/Applications/FreeCAD.app/Contents/Resources/share/" that might be the problem.

What is your preference setting in the Files section of the General tab for Line Group File? Is it the path with the ".20" or the one without it (or something else entirely)?

Does the path '/Applications/FreeCAD .20.app/Contents/Resources/share/' exist and does it have a line group file in it?
I believe I found the problem. Although the path I indicated in my OP was and is the path shown by both FreeCAD .19 and .20 when I look in the TechDraw Prefs Files section it seems FreeCAD was somehow confused by the fact I had renamed the two versions I have FreeCAD .19.app and FreeCAD .20.app respectively so that I could keep both versions in the Applications folder. (Obviously you can't have two apps with the same name in the same folder.) Reverting the names of the apps to FreeCAD.app doesn't change the path used by TechDraw but it does eliminate the error message.

Also, just for the possibility it might end some clarity, even though I was getting the error message I mentioned in my OP the app still functioned as expected. It seems FreeCAD thought it couldn't find the .csv file even though it was finding it just fine. Does that sound plausible?
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: LineGroup.csv is not readable

Post by wandererfan »

RussG wrote: Sun Aug 07, 2022 8:25 pm It seems FreeCAD thought it couldn't find the .csv file even though it was finding it just fine. Does that sound plausible?
If it can't find the file listed in preferences (no "20"), it uses the default file (with the "20").
RussG
Posts: 124
Joined: Wed Apr 27, 2022 11:27 pm

Re: LineGroup.csv is not readable

Post by RussG »

wandererfan wrote: Mon Aug 08, 2022 12:14 pm
RussG wrote: Sun Aug 07, 2022 8:25 pm It seems FreeCAD thought it couldn't find the .csv file even though it was finding it just fine. Does that sound plausible?
If it can't find the file listed in preferences (no "20"), it uses the default file (with the "20").
The path in prefs was correct. The file existed. FreeCAD should have found the .csv file but did not. Somehow, renaming the app from FreeCAD.app to FreeCAD .20.app threw it off, but shouldn't have.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: LineGroup.csv is not readable

Post by adrianinsaval »

what path was set in your preferences?
RussG
Posts: 124
Joined: Wed Apr 27, 2022 11:27 pm

Re: LineGroup.csv is not readable

Post by RussG »

adrianinsaval wrote: Mon Aug 08, 2022 3:16 pm what path was set in your preferences?
Here is the path in the error message copied from my OP and immediately below it the path copied from the TechDraw Prefs. As you can see they are the same.
/Applications/FreeCAD.app/Contents/Resources/share/Mod/TechDraw/LineGroup/LineGroup.csv
/Applications/FreeCAD.app/Contents/Resources/share/Mod/TechDraw/LineGroup/LineGroup.csv

I tried to indicate in my OP that the path shown in the TechDraw Prefs was correct, the same as that shown in the error message but perhaps I wasn't as clear as I could have been. As I mentioned above, I believe the error message I first reported was related to the fact I had changed the name of the app.

I would be very interested to hear if someone can duplicate the problem on the Mac platform (and perhaps others as well). The first step would be to change the name of the application from FreeCAD.app to something else, or better yet to "FreeCAD .20.app" or "FreeCAD .19.app" which is what I did. Then open the app and a file that includes a TechDraw document. If my guess is correct that will replicate the error message I reported in my OP. Next, close the file and the app, rename the app back to "FreeCAD.app", restart the app and reopen the same file. If my guess is correct the file will open without the error message once the app has been renamed back to its original name "FreeCAD.app"
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: LineGroup.csv is not readable

Post by adrianinsaval »

I don't use mac so I'm sorry if this is a stupid question, but doesn't this path (/Applications/FreeCAD.app/Contents/Resources/share/Mod/TechDraw/LineGroup/LineGroup.csv) stop existing if you change the name of the app?
If so then as soon as you change the name of the app the preference setting is not correct anymore so you would have to adjust to the new name you gave it.
Post Reply