Skip to content

FileExistsError at installation #418

Open

Description

@jvdkwast

What is the bug?

When I install QuickOSM from the Plugins Manager in QGIS 3.26 on Windows I get a FileExistsError. This bug was reproduced on a laptop of another user.

Couldn't load plugin 'QuickOSM' due to an error when calling its classFactory() method 

FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\Users\\hansa\\AppData\\Roaming\\QGIS\\QGIS3\\profiles\\QuickOSMTest\\python\\plugins\\QuickOSM\\resources\\i18n\\preset_cs-rCZ.po' -> 'C:\\Users\\hansa\\AppData\\Roaming\\QGIS\\QGIS3\\profiles\\QuickOSMTest\\python\\plugins\\QuickOSM\\resources\\i18n\\preset_cs_CZ.po' 
Traceback (most recent call last):
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 423, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:\Users/hansa/AppData/Roaming/QGIS/QGIS3\profiles\QuickOSMTest/python/plugins\QuickOSM\__init__.py", line 12, in classFactory
    return QuickOSMPlugin(iface)
  File "C:\Users/hansa/AppData/Roaming/QGIS/QGIS3\profiles\QuickOSMTest/python/plugins\QuickOSM\quick_osm.py", line 74, in __init__
    self.extract_zip_file()
  File "C:\Users/hansa/AppData/Roaming/QGIS/QGIS3\profiles\QuickOSMTest/python/plugins\QuickOSM\quick_osm.py", line 123, in extract_zip_file
    os.rename(file_path, new_file_path)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\Users\\hansa\\AppData\\Roaming\\QGIS\\QGIS3\\profiles\\QuickOSMTest\\python\\plugins\\QuickOSM\\resources\\i18n\\preset_cs-rCZ.po' -> 'C:\\Users\\hansa\\AppData\\Roaming\\QGIS\\QGIS3\\profiles\\QuickOSMTest\\python\\plugins\\QuickOSM\\resources\\i18n\\preset_cs_CZ.po'


Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] 
QGIS version: 3.26.2-Buenos Aires Buenos Aires, feec3d3b12f 

Python Path:
C:/OSGeo4W/apps/qgis/./python
C:/Users/hansa/AppData/Roaming/QGIS/QGIS3\profiles\QuickOSMTest/python
C:/Users/hansa/AppData/Roaming/QGIS/QGIS3\profiles\QuickOSMTest/python/plugins
C:/OSGeo4W/apps/qgis/./python/plugins
C:\OSGeo4W\bin\python39.zip
C:\OSGeo4W\apps\Python39\DLLs
C:\OSGeo4W\apps\Python39\lib
C:\OSGeo4W\bin
C:\OSGeo4W\apps\Python39
C:\OSGeo4W\apps\Python39\lib\site-packages
C:\OSGeo4W\apps\Python39\lib\site-packages\win32
C:\OSGeo4W\apps\Python39\lib\site-packages\win32\lib
C:\OSGeo4W\apps\Python39\lib\site-packages\Pythonwin
C:/Users/hansa/AppData/Roaming/QGIS/QGIS3\profiles\QuickOSMTest/python

Environment

  • QuickOSM version: 2.1.0
  • QGIS version: 3.26.2
  • OS: Windows

Activity

  1. added
    bug
    on Aug 20, 2022
  2. jvdkwast commented on Aug 20, 2022

    @jvdkwast
    Author

    The same happens on QGIS 3.22.10.

  3. Gustry commented on Aug 21, 2022

    @Gustry
    Collaborator

    Temporary fixed, but I want to keep the ticket open to clean a little bit the code.
    Commit b43c05d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions