Skip to content

Error on dsettings when Project is stored in a database #98

@jnelopenspatial

Description

@jnelopenspatial

When accessing Dsettings I get an error
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:/Users/xxxx/Documents/oracle:'

Full message
Traceback (most recent call last):
File "C:\Users/xxxx/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qad\qad_dsettings_dlg.py", line 433, in ButtonBOX_Accepted
QadVariables.save()
File "C:\Users/xxxxx/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qad\qad_variables.py", line 1250, in save
self.__saveVariables(projectPath, QadVariableLevelEnum.PROJECT)
File "C:\Users/xxxx/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qad\qad_variables.py", line 1206, in __saveVariables
os.makedirs(dir.absolutePath())
File "", line 225, in makedirs
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:/Users/xxxx/Documents/oracle:'

I traced it back to the difference in project loading. If the project is loaded from a file it works fine. The project is stored in an Oracle database

Running
from qgis.core import QgsProject
print("Project fileName:", QgsProject.instance().fileName())
print("Project homePath:", QgsProject.instance().homePath())

the homePath returns : Project homePath: oracle:/

I added a path to the Project home under project properties but the error persists.
Changing between absolute or relative paths also did not make a difference

ChatGPT (Yeah I know) suggests Plugins assuming fileName() is a filesystem path break when projects are stored in Oracle DB. They should use homePath() instead.”

Thanks

Johan Nel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions