ponty / PyVirtualDisplay

Python wrapper for Xvfb, Xephyr and Xvnc
BSD 2-Clause "Simplified" License
714 stars 78 forks source link

TypeError: __init__() got an unexpected keyword argument 'url' #49

Closed LarryMartell closed 4 years ago

LarryMartell commented 4 years ago

I have some code that uses the pyvirtualdisplay package and it works fine.

pyvirtualdisplay.Display calls EasyProcess like this:

       @classmethod
       def check_installed(cls):
           EasyProcess([PROGRAM, '-help'], url=URL,
                       ubuntu_package=PACKAGE).check_installed()

I made a branch and made some changes. In the branch, when I instantiate Display and it gets to this point it fails with:

TypeError: init() got an unexpected keyword argument 'url'

There are no changes in my branch related to using Display. What's very odd is that the init() function for EasyProcess has this signature, and the call to it from Display is the same in my master branch and it works:

    def __init__(
        self, cmd, cwd=None, use_temp_files=True, env=None,
    ):

So that url param must be getting passed to something else.

I did some googling and found a post on SO where someone was having the same issue, and the answer was that they overrode the EasyProcess init with their own init. If I am doing that I have no clue how that could be. I did inspect EasyProcess just before the call and it was the correct code.

Here is the end of the stack trace:

-> display = Display(visible=0, size=(800, 600))
> /usr/local/lib/python3.7/site-packages/pyvirtualdisplay/display.py(33)__init__()
-> self._obj = self.display_class(
  /usr/local/lib/python3.7/site-packages/pyvirtualdisplay/display.py(51)display_class()
-> cls.check_installed()
  /usr/local/lib/python3.7/site-packages/pyvirtualdisplay/xvfb.py(38)check_installed()
-> ubuntu_package=PACKAGE).check_installed()

Anyone have any thoughts on what could be causing this or how I can debug it further?

ponty commented 4 years ago

EasyProcess is a dependency of pyvirtualdisplay. You upgraded only EasyProcess, but pyvirtualdisplay is still old. If you upgrade both then they will be compatible.

pip3 install pyvirtualdisplay -U
LarryMartell commented 4 years ago

Thanks! That did the trick.