Python queries just got really slow, better alternative?

I have a web server with some pages using Python scripts as backend. About half a dozen of them use the Queries module to retrieve online resources in real time. This has worked great for a long time. After updating to the latest Debian (jessie), each request takes about 1 second longer.

From what I have learned, the requests module in turn imports openssl and that import is used where the extra second is spent. This is reported to be a bug and it will eventually be resolved I'm sure. I am not using HTTPS and was hoping that I could somehow disable the SSL part, but did not find a suitable parameter / parameter.

How does it work in Debian? I was told that stable releases only receive security fixes. The slow module is not security related, so it won't be allowed (apt-get way) until the next stable Debian?

The extra 1 second wait is not acceptable, so I will most likely rewrite my modules without prompts. It's a shame; I really liked the queries.

What is a good query replacement? There seem to be three versions from urllib incompatible with each other?

+3


source to share


1 answer


Thanks to the guys in the comments above, the problem was resolved. I replaced the apts version of the Requests package with pips by doing something like this:

apt-get remove python-requests
apt-get install libffi-dev
pip install --upgrade requests
pip install --upgrade pyOpenSSL

      



The package packages above were already installed, but versions were available. pip freeze says the versions I currently have are pyOpenSSL == 0.15.1 and requests == 2.7.0 and that works fine.

+1


source







All Articles