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

Error in Python link mypy: "object" has no attribute "close" #25

Open
ibc opened this issue Sep 14, 2023 · 0 comments
Open

Error in Python link mypy: "object" has no attribute "close" #25

ibc opened this issue Sep 14, 2023 · 0 comments

Comments

@ibc
Copy link
Member

ibc commented Sep 14, 2023

NOTE: Due to this bug, lintPython() is commented out in checkRelease() in npm-scripts.mjs. Also, in CI file, npm run lint:node is used instead of npm run lint to avoid this issue.

$ npm run lint:python


> mediasoup-client-aiortc@3.7.3 lint:python
> node npm-scripts.mjs lint:python

npm-scripts [INFO] [lint:python] lintPython()
npm-scripts [INFO] [lint:python] executeCmd(): cd worker && python3.10 -m flake8 && cd ..
npm-scripts [INFO] [lint:python] executeCmd(): cd worker && python3.10 -m mypy . && cd ..
channel.py:67: error: "object" has no attribute "close"  [attr-defined]
channel.py:74: error: "object" has no attribute "read"  [attr-defined]
channel.py:94: error: "object" has no attribute "write"  [attr-defined]
Found 3 errors in 1 file (checked 5 source files)

Offending code is this (one of them):

if self._writer is not None:
            self._writer.close()

Note that self._writer is defined as follows:

self._writer = Union[StreamWriter, None]

However, in theory, we are checking that it's not None but ¯_(ツ)_/¯

@ibc ibc mentioned this issue Sep 14, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant