alejandroautalan / pygubu-designer

A simple GUI designer for the python tkinter module
GNU General Public License v3.0
800 stars 98 forks source link

Can't load custom widgets - project path containing a windows link #249

Closed JojoMueller closed 4 months ago

JojoMueller commented 4 months ago

When I try to load a py file registering custom widgets - now in the project settings dialog - an error occurs in method Project.get_relative_path(): "ValueError: path is on mount 'C:', start on mount 'G:'"

Python function os.path.relpath(path, start=self.fpath.parent) assumes, 'path' (of project widget builder file) and 'start' (directory holding the ui file) are on the same drive. Which is true in my case! But the common path C:\Users\MuellerJ\Documents\Code\ of 'path' and 'start' holds a link, a Windows junction: 'Documents\Code' refers to a folder in an an encrypted container, mounted as G.
Unfortunatly some python functions resolve those links automatically. So self.fpath is resolved from C:\Users\MuellerJ\Documents\Code... to G:\MuellerJ\Code...

This problem does not occure before v39.

Steps to reproduce Open an ui-file with pygubu designer and add a project widget builder in project settings dialog, where both files are choosen from a windows junction.

Your Environment (please complete the following information):

alejandroautalan commented 4 months ago

Fixed in pygubu-designer v0.39.2 Please try again and let me know.

Regards Alejandro A.

JojoMueller commented 4 months ago

Thanks for fixing. Works as excepted now.