Skip to content

Qt6/Python 3.12 crash: QDialog.Accepted and QHttpMultiPart.FormDataType enums not found #741

@Linus-007

Description

@Linus-007

What is the bug or the crash? What were your expectations and what actually happened?

Environment

OS: Windows 11
QGIS: 3.40.14 LTR (Qt 6)
Python: 3.12.12
QFieldSync plugin: [PUT VERSION HERE]

Description

On QGIS 3.40 (Qt6 / Python 3.12), QFieldSync crashes during

  1. QField Cloud login, and
  2. QField Cloud upload

Errors indicate use of Qt5-style enums that no longer exist in Qt6.

Error 1 (login crash)

AttributeError: type object 'QDialog' has no attribute 'Accepted'

Error 2 (upload crash)

AttributeError: type object 'QHttpMultiPart' has no attribute 'FormDataType'

Failing code paths

cloud_login_dialog.py

self.done(QDialog.Accepted)

cloud_api.py

QHttpMultiPart(QHttpMultiPart.FormDataType)

Qt6-correct equivalents

self.done(QDialog.DialogCode.Accepted)
QHttpMultiPart(QHttpMultiPart.ContentType.FormDataType)

Workaround

Manually patching the above lines resolves both crashes and allows
QField Cloud project creation and upload to complete successfully.

Impact

QField Cloud is unusable on QGIS 3.40 LTR + Python 3.12 without manual patching.

Reinstalling does not resolve it

Stale wheel caching appears to mask fixes

Steps to reproduce the issue

An error has occurred while executing Python code: AttributeError: type object 'QHttpMultiPart' has no attribute 'FormDataType' Traceback (most recent call last): File "C:\Users/linus/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qfieldsync\core\cloud_transferrer.py", line 313, in _on_localized_datasets_upload_finished self._upload() File "C:\Users/linus/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qfieldsync\core\cloud_transferrer.py", line 222, in _upload self.throttled_uploader.transfer() File "C:\Users/linus/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qfieldsync\core\cloud_transferrer.py", line 737, in transfer transfer.transfer() File "C:\Users/linus/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qfieldsync\core\cloud_transferrer.py", line 536, in transfer reply = self.network_manager.cloud_upload_files( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users/linus/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qfieldsync\core\cloud_api.py", line 850, in cloud_upload_files multi_part = QHttpMultiPart(QHttpMultiPart.FormDataType) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: type object 'QHttpMultiPart' has no attribute 'FormDataType' Python version: 3.12.12 (main, Oct 14 2025, 23:38:06) [MSC v.1944 64 bit (AMD64)] QGIS version: 3.40.14-Bratislava Bratislava, ebe1e1f3 Python Path: C:/PROGRA1/QGISQT1.14/apps/qgis-ltr-qt6/./python C:/Users/linus/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:/Users/linus/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins C:/PROGRA1/QGISQT1.14/apps/qgis-ltr-qt6/./python/plugins C:\PROGRA1\QGISQT1.14\apps\grass\grass84\etc\python C:\Users\linus\Documents C:\Program Files\QGISQT6 3.40.14\bin\python312.zip C:\PROGRA1\QGISQT1.14\apps\Python312\DLLs C:\PROGRA1\QGISQT1.14\apps\Python312\Lib C:\Program Files\QGISQT6 3.40.14\bin C:\PROGRA1\QGISQT1.14\apps\Python312 C:\PROGRA1\QGISQT1.14\apps\Python312\Lib\site-packages C:\PROGRA1\QGISQT1.14\apps\Python312\Lib\site-packages\win32 C:\PROGRA1\QGISQT1.14\apps\Python312\Lib\site-packages\win32\lib C:\PROGRA1\QGISQT1.14\apps\Python312\Lib\site-packages\Pythonwin C:/Users/linus/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:\Users\linus\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qfieldsync\libqfieldsync_ed003e83912f1e28435d0789afc67acf17c44be8.whl

QGIS version

3.40.14-Bratislava

QFieldSync Version

qfieldsync-v4.18.0

Operating system name

Windows

Operating system version

11

Reinstall QFieldSync

  • I have a fresh install of the latest QFieldSync version on a new QGIS profile, but the problem persists.
  • Problem can be reliably reproduced, doesn't happen randomly.
  • Problem happens with all files and projects, not only some files or projects.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions