jeanphix/Ghost.py

TypeError: __call__() takes 3 positional arguments but 4 were given

aorzh opened this issue · 4 comments

aorzh commented

I use Qt 5.5.1/ PySide2 and dev version of ghost.py.
When I'm trying to use example like
`from ghost import Ghost
ghost = Ghost()

with ghost.start() as session:
page, extra_resources = session.open("http://jeanphix.me")
assert page.http_status == 200 and 'jeanphix' in page.content`
I'm getting this traceback.
https://gist.github.com/aorzh/3bec4ad0661f7d07d6c6818b7eadbf89

But just now I tested it in console and all works perfect :/

aorzh commented

And I use Python 3.5.
It looks like some basic bug, but its strange. Looks only I got it...

i got some exception too with session.open('http://opu.ua'), but it works, for example, with session.open('http://ac.opu.ua')
Traceback:
File "/usr/local/lib/python3.5/dist-packages/ghost/ghost.py", line 856, in open
return self.wait_for_page_loaded(timeout=timeout)
File "/usr/local/lib/python3.5/dist-packages/ghost/ghost.py", line 1157, in wait_for_page_loaded
'Unable to load requested page', timeout)
File "/usr/local/lib/python3.5/dist-packages/ghost/ghost.py", line 1136, in wait_for
self.sleep()
File "/usr/local/lib/python3.5/dist-packages/ghost/ghost.py", line 1122, in sleep
self.ghost._app.processEvents()
TypeError: call() takes 3 positional arguments but 4 were given

I get the same error, but not every time. Sometimes it works to fetch data.
Python 3.6.3
PySide2
Qt5.9

@jeanphix care to chime in? I'm getting the same bug using the official docker image. Here's the code and traceback:

from ghost import Ghost


ghost = Ghost()
with ghost.start() as session:
    session.open('https://bittrex.com/Account/Login', timeout=60)
browser_1    | Traceback (most recent call last):
browser_1    |   File "/usr/local/lib/python3.5/dist-packages/rq/worker.py", line 771, in perform_job
browser_1    |     rv = job.perform()
browser_1    |   File "/usr/local/lib/python3.5/dist-packages/rq/job.py", line 558, in perform
browser_1    |     self._result = self._execute()
browser_1    |   File "/usr/local/lib/python3.5/dist-packages/rq/job.py", line 564, in _execute
browser_1    |     return self.func(*self.args, **self.kwargs)
browser_1    |   File "/browser/app/hello.py", line 7, in say_hello_to
browser_1    |     session.open('http://bittrex.com/Account/Login', timeout=60)
browser_1    |   File "/usr/local/lib/python3.5/dist-packages/ghost/ghost.py", line 856, in open
browser_1    |     return self.wait_for_page_loaded(timeout=timeout)
browser_1    |   File "/usr/local/lib/python3.5/dist-packages/ghost/ghost.py", line 1157, in wait_for_page_loaded
browser_1    |     'Unable to load requested page', timeout)
browser_1    |   File "/usr/local/lib/python3.5/dist-packages/ghost/ghost.py", line 1136, in wait_for
browser_1    |     self.sleep()
browser_1    |   File "/usr/local/lib/python3.5/dist-packages/ghost/ghost.py", line 1122, in sleep
browser_1    |     self.ghost._app.processEvents()
browser_1    | TypeError: __call__() takes 3 positional arguments but 4 were given