Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sslErrors attribute in Ghost.py #140

Closed
aflaxman opened this issue Jul 7, 2014 · 13 comments
Closed

sslErrors attribute in Ghost.py #140

aflaxman opened this issue Jul 7, 2014 · 13 comments

Comments

@aflaxman
Copy link

aflaxman commented Jul 7, 2014

I'm trying to use Ghost.py with the anaconda python distribution, and running into an issue with the self.manager.sslErrors.connect call. Do you have any ideas for a fix or work-around?

Here is the full error:

C:\Users\abie\AppData\Local\Continuum\Anaconda>ipython
Python 2.7.6 |Anaconda 1.9.1 (64-bit)| (default, Nov 11 2013, 10:49:15) [MSC v.1500 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 2.1.0 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from ghost import Ghost

In [2]: ghost = Ghost()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-570d03f31ecf> in <module>()
----> 1 ghost = Ghost()

C:\Users\abie\AppData\Local\Continuum\Anaconda\lib\site-packages\ghost\ghost.pyc in __init__(self, user_agent, wait_timeout, wait_ca
llback, log_level, display, viewport_size, ignore_ssl_errors, cache_dir, plugins_enabled, java_enabled, plugin_path, download_images
, qt_debug, show_scroolbars)
    330         self.manager = self.page.networkAccessManager()
    331         self.manager.finished.connect(self._request_ended)
--> 332         self.manager.sslErrors.connect(self._on_manager_ssl_errors)
    333         # Cache
    334         if cache_dir:

AttributeError: 'PySide.QtNetwork.QNetworkAccessManager' object has no attribute 'sslErrors'

This is using pyside 1.2.1:

C:\Users\abie\AppData\Local\Continuum\Anaconda>conda update pyside
Fetching package metadata: ..
# All requested packages already installed.
# packages in environment at C:\Users\abie\AppData\Local\Continuum\Anaconda:
#
pyside                    1.2.1                    py27_0

I posted a similar issue in the Ghost.py issue tracker here

@nikescar
Copy link

http://permalink.gmane.org/gmane.comp.python.pyqt-pykde/26977
check this thread. your pyside may compiled with no open ssl support.
to fix the problem.

pip uninstall PySide
pip install -U PySide

will do for you.

@brandon-rhodes
Copy link

I am in a more Anaconda-specific position. Rather than getting this error because of a third-party PySide installation, I am getting it directly from the PyQt library that was installed directly by conda.

$ conda list pyqt
# packages in environment at /home/brandon/.v/fopnp-py3:
#
pyqt                      4.10.4                   py34_0  

In the next version of PyQt, could Continuum.io set the compile options on PyQt so that it can discover the version of OpenSSL that you ship and thus make libraries like ghost.py able to operate under the Anaconda-installed Python? Thanks!

@asmeurer
Copy link
Contributor

We can try. Is it pyqt or qt itself? QT doesn't really have compile options. It just finds whatever it can when it runs its configuration script and compiles in support for and links against whatever it finds.

@brandon-rhodes
Copy link

The problem is with Qt itself, if I am interpreting the lack of “ssl” symbols in Anaconda’s version of the library correctly:

$ nm -CD /usr/lib/i386-linux-gnu/libQtNetwork.so.4.8.6 | grep ssl
000db5f0 T QSslSocket::sslErrors(QList<QSslError> const&)
000f2520 T QNetworkReply::sslErrors(QList<QSslError> const&)
00053b10 T QNetworkAccessManager::sslErrors(QNetworkReply*, QList<QSslError> const&)
00032930 T QHttp::sslErrors(QList<QSslError> const&)
000dd5b0 T QSslSocket::sslConfiguration() const
000df230 T QSslSocket::sslErrors() const
00070f80 T QNetworkReply::sslConfiguration() const
0006d120 T QNetworkRequest::sslConfiguration() const
$ nm -CD .anaconda/lib/libQtNetwork.so.4.8.5 | grep ssl
$

@asmeurer
Copy link
Contributor

In theory, it should be enough to add openssl to the build requirements of qt (and double check that it is enabled in the configure step).

@asmeurer
Copy link
Contributor

@brandon-rhodes can you try the qt package I just built and put on my binstar. conda install -c asmeurer qt. It is for 64-bit Linux only.

@asmeurer
Copy link
Contributor

Ah just noticed that the configuration script still lists no openssl support. So maybe it does have to be enabled with a flag somehow.

@asmeurer
Copy link
Contributor

I'm not sure. If I set the -openssl or -openssl-linked flags (and also include openssl in the build requirements) it doesn't want to build with OpenSSL support.

@brandon-rhodes
Copy link

I wonder what it does not like your OpenSSL, when you have it included in all of the build and LD_LIBRARY_PATH settings? (I have not been able to try your 64-bit build yet because my machine is 32-bit.)

@asmeurer
Copy link
Contributor

I deleted my build from binstar once I realized it wasn't any good. If I play with this more I will build on a 32-bit machine.

@goanpeca
Copy link

I am running in the same issue on:
'QNetworkReply' object has no attribute 'sslErrors'

I am running on Ubuntu with
Python 2.7.9 64bits, Qt 4.8.5, PyQt4 (API v2) 4.10.4 on Linux

@ccordoba12
Copy link

Since Anaconda 2.2, Qt is complied against our openssl package. This means that the Ssl symbols are now part of Qt and PyQt.

@brandon-rhodes
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants