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

AttributeError: 'NoneType' object has no attribute 'isatty' #3

Closed
MonoS opened this issue Oct 2, 2022 · 1 comment
Closed

AttributeError: 'NoneType' object has no attribute 'isatty' #3

MonoS opened this issue Oct 2, 2022 · 1 comment

Comments

@MonoS
Copy link

MonoS commented Oct 2, 2022

When importing lvsfunc or vsaa i get error
AttributeError: 'NoneType' object has no attribute 'isatty'

The full traceback

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 2890, in vapoursynth._vpy_evaluate
File "src\cython\vapoursynth.pyx", line 2891, in vapoursynth._vpy_evaluate
File "F:\test.vpy", line 6, in import lvsfunc
File "C:\Program Files\Python310\lib\site-packages\lvsfunc\__init__.py", line 12, in 
from . import (aa, comparison, deblock, dehalo, dehardsub, deinterlace, exceptions, fun, helpers, mask, misc, noise,
File "C:\Program Files\Python310\lib\site-packages\lvsfunc\aa.py", line 7, in 
from vskernels import Bicubic, Box, Catrom, Point
File "C:\Program Files\Python310\lib\site-packages\vskernels\__init__.py", line 15, in 
from . import exceptions, kernels, util
File "C:\Program Files\Python310\lib\site-packages\vskernels\exceptions.py", line 5, in 
from vstools import CustomValueError, FuncExceptT
File "C:\Program Files\Python310\lib\site-packages\vstools\__init__.py", line 1, in 
from .enums import * # noqa: F401, F403
File "C:\Program Files\Python310\lib\site-packages\vstools\enums\__init__.py", line 1, in 
from .base import * # noqa: F401, F403
File "C:\Program Files\Python310\lib\site-packages\vstools\enums\base.py", line 6, in 
from ..exceptions import NotFoundEnumValue
File "C:\Program Files\Python310\lib\site-packages\vstools\exceptions\__init__.py", line 1, in 
from .base import * # noqa: F401, F403
File "C:\Program Files\Python310\lib\site-packages\vstools\exceptions\base.py", line 40, in 
class CustomError(Exception, metaclass=CustomErrorMeta):
File "C:\Program Files\Python310\lib\site-packages\vstools\exceptions\base.py", line 32, in __new__
if sys.stdout.isatty():
AttributeError: 'NoneType' object has no attribute 'isatty'

I've updated lvsfunc, vsaa and vstools from git passing the --upgrade flag to pip.

@Setsugennoao
Copy link
Member

Thanks for the error report.

Apparently stdout can sometimes not be connected, and it'll result in it being None.
Even print internally has a check for it.
https://github.com/python/cpython/blob/3.11/Python/bltinmodule.c#L2000-L2003

Fixed it in adaa2fd

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

2 participants