vncdotool
vncdotool copied to clipboard
TypeError: VNCDoToolClient.captureScreen() missing 1 required positional argument: 'fp'
client.captureScreen("tmp/1.png")
TypeError: VNCDoToolClient.captureScreen() missing 1 required positional argument: 'fp'
Environment:
Mac OS 15.5 (MacBookPro M4 MAX) Python 3.12 (Install via Brew, within VirtualEnv) vncdotool==1.2.0 Execute in Notebook (VS Code with Jupyter plugin)
Fixed:
Modify .venv/lib/python3.12/site-packages/vncdotool/client.py@256-266:
Add TClient annotation to self:
def captureScreen(self: TClient, fp: TFile, incremental: bool = False) -> Deferred:
"""Save the current display to filename"""
log.debug("captureScreen %s", fp)
return self._capture(fp, incremental)
def captureRegion(
self: TClient, fp: TFile, x: int, y: int, w: int, h: int, incremental: bool = False
) -> Deferred:
"""Save a region of the current display to filename"""
log.debug("captureRegion %s", fp)
return self._capture(fp, incremental, x, y, x + w, y + h)
No, your fix is wrong: self does not need a type annotation.
https://github.com/sibson/vncdotool/blob/main/vncdotool/client.py#L256
Maybe related to #266