Hi Frank, Moving this to dev list as I think that is more appropriate for this question.
I can easily replicate your issue (on Debian Testing, see below the coredump.txt) BUT: are you sure you want to use it outside of QGIS in a standalone script? Because I think these things will need some kind of Qt-Application to run... (as the Application is responsible for stuff like NetWorkProxies, and has the actual 'NetWorkAccessManager'?). But all just guessing... Using your code in a minimal HelloWorldPlugin (attached), it just works. (the url I'm using just sents 'ok' as text). So: I would not try to run it in a standalone script without a QGIS application context, but in a plugin it 'works'? Regards, Richard Duivenvoorde PID: 18825 (gnome-shell) UID: 1000 (richard) GID: 1000 (richard) Signal: 11 (SEGV) Timestamp: Sat 2021-03-06 16:16:12 CET (3min 52s ago) Command Line: /usr/bin/gnome-shell Executable: /usr/bin/gnome-shell Control Group: /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@wayland.service Unit: user@1000.service User Unit: org.gnome.Shell@wayland.service Slice: user-1000.slice Owner UID: 1000 (richard) Boot ID: 4aaa450c98ed47b299254a234e463620 Machine ID: df76fc45bc594c71b48c4eb87da1774e Hostname: oost Storage: /var/lib/systemd/coredump/core.gnome-shell.1000.4aaa450c98ed47b299254a234e463620.18825.1615043772000000.zst Message: Process 18825 (gnome-shell) of user 1000 dumped core. ················ Stack trace of thread 18825: #0 0x00007fe88cf6003d g_type_check_instance (libgobject-2.0.so.0 + 0x3503d) #1 0x00007fe88cf50883 g_signal_handler_disconnect (libgobject-2.0.so.0 + 0x25883) #2 0x00007fe88cf42eef n/a (libgobject-2.0.so.0 + 0x17eef) #3 0x00007fe88ce2dfae n/a (libglib-2.0.so.0 + 0x31fae) #4 0x00007fe88cf440a3 g_object_unref (libgobject-2.0.so.0 + 0x190a3) #5 0x00007fe88d1c1df8 n/a (libgnome-shell.so + 0x21df8) #6 0x00007fe88cf440a3 g_object_unref (libgobject-2.0.so.0 + 0x190a3) #7 0x00007fe88c546c7e n/a (libgjs.so.0 + 0x47c7e) #8 0x00007fe88c546d5a n/a (libgjs.so.0 + 0x47d5a) #9 0x00007fe88c542588 n/a (libgjs.so.0 + 0x43588) #10 0x00007fe88c542673 n/a (libgjs.so.0 + 0x43673) #11 0x00007fe88aa3681c n/a (libmozjs-78.so.0 + 0x65381c) #12 0x00007fe88aa073be n/a (libmozjs-78.so.0 + 0x6243be) #13 0x00007fe88aa10c02 n/a (libmozjs-78.so.0 + 0x62dc02) #14 0x00007fe88aa18ac5 n/a (libmozjs-78.so.0 + 0x635ac5) #15 0x00007fe88aa330b6 n/a (libmozjs-78.so.0 + 0x6500b6) #16 0x00007fe88aa337dc n/a (libmozjs-78.so.0 + 0x6507dc) #17 0x00007fe88aa33a6c n/a (libmozjs-78.so.0 + 0x650a6c) #18 0x00007fe88aa33d25 n/a (libmozjs-78.so.0 + 0x650d25) #19 0x00007fe88c55dc1f n/a (libgjs.so.0 + 0x5ec1f) #20 0x00007fe88ce4e8f4 n/a (libglib-2.0.so.0 + 0x528f4) #21 0x00007fe88ce4dd6f g_main_context_dispatch (libglib-2.0.so.0 + 0x51d6f) #22 0x00007fe88ce4e118 n/a (libglib-2.0.so.0 + 0x52118) #23 0x00007fe88ce4e40b g_main_loop_run (libglib-2.0.so.0 + 0x5240b) #24 0x00007fe88c27627e meta_init (libmutter-7.so.0 + 0xc529e) #25 0x00007ffd8eec1f9c n/a (n/a + 0x0) #26 0x455059545f4e4f49 n/a (n/a + 0x0) On 5/22/21 3:32 PM, Frank Broniewski wrote: > Hi all, > > I am trying to replace the `requests` module with QgsBlockingNetworkRequest > to > remove a potentially unnecessary dependency from my QGIS plugin. But I am > having trouble using it so far as Python crashes on the command line with a > SIGSEGV all the time. First of all, things work from within the QGIS Python > shell. But not from the command line outside of QGIS. > > I am running Fedora 34 KDE spin, but I also tested on Ubuntu 20.04 with the > same failure. It is rather simple to reproduce on my end: > > 1) open a Python3 shell > 2) >>> import qgis >>>> from qgis.core import QgsBlockingNetworkRequest as bnr >>>> r = bnr() > fish: Job 1, 'python' terminated by signal SIGSEGV (Adressbereichsfehler) > > I did look at the unittest Testcases [1] for the class, e.g the > testFetchEmptyUrl class method and do not see anything that I could have > changed to avoid the SIGSEGV. > > So, can I not use QgsBlockingNetworkRequest outside of QGIS or am I just > missing something? > > Any tips are greatly appreciated, > Frank > > > [1] https://github.com/qgis/QGIS/blob/master/tests/src/python/ > test_qgsblockingnetworkrequest.py > > > _______________________________________________ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user >
<<attachment: HelloWorldPlugin.zip>>
_______________________________________________ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user