<div dir="ltr">Hello,<br>I'm currently working on an application that sends some requests using PyQt, but multipart formdata post requests are giving me trouble.<br><br>Get requests and simple post requests (with just binary data as body) work without any problems, but requests that contain QHttpMultiPart as body crash Python with the following:<br>fish: Job 1, 'pipenv run python post.py' terminated by signal SIGSEGV (Address boundary error)<br><br>I'm using PyQt5 with Python 3.11.5, but the same issue occurs in PyQt6 as well.<br>You can find a minimal example below, if anyone would like to test this for themselves.<br><br>Any ideas why this program crashes?<br><br>All the best,<br>Simon Leitgeb<br><br>post.py<br>```python<br>#!/usr/bin/env python3<br><br>import sys<br>from PyQt5.QtCore import QUrl, QCoreApplication, QByteArray<br>from PyQt5.QtNetwork import (<br>    QNetworkAccessManager,<br>    QNetworkRequest,<br>    QNetworkReply,<br>    QHttpPart,<br>    QHttpMultiPart,<br>)<br><br><br>class Example:<br>    def __init__(self):<br>        self.network_manager = QNetworkAccessManager()<br>        self.multipart_post()<br><br>    def multipart_post(self):<br>        URL = "<a href="http://httpbin.org/post">http://httpbin.org/post</a>"<br>        body = QHttpMultiPart(QHttpMultiPart.ContentType.FormDataType)<br>        boundary = body.boundary()<br>        part = QHttpPart()<br>        part.setHeader(<br>            QNetworkRequest.KnownHeaders.ContentTypeHeader, "application/json"<br>        )<br>        part.setHeader(<br>            QNetworkRequest.KnownHeaders.ContentDispositionHeader,<br>            'form-data; name="test"',<br>        )<br>        data = QByteArray()<br>        data.append(b"test")<br>        part.setBody(data)<br>        body.append(part)<br>        request = QNetworkRequest(QUrl(URL))<br>        request.setHeader(QNetworkRequest.KnownHeaders.ContentTypeHeader, f'multipart/form-data; boundary={str(boundary, "utf-8")}')<br>        self.network_manager.finished.connect(self.handle_reply)<br>        response = <a href="http://self.network_manager.post">self.network_manager.post</a>(request, body)<br>        print(response)<br><br>    def handle_reply(self, reply):<br>        print(reply.error())<br>        print(reply.readAll())<br>        QCoreApplication.quit()<br><br><br>def main():<br>    app = QCoreApplication([])<br>    ex = Example()<br>    sys.exit(app.exec())<br><br><br>if __name__ == "__main__":<br>    main()<br>```<br></div>