Skip to content

io.UnsupportedOperation when executing inside PyCharm #9

@CharlesB2

Description

@CharlesB2

If capturer is run inside the PyCharm IDE environment, the following error occurs:

Error
Traceback (most recent call last):
  File "/Users/charles3/prog/opu/python/test/test_logging.py", line 27, in test_log_debug
    with CaptureOutput() as capturer:
  File "/Users/charles3/prog/venvs/vopu/lib/python3.5/site-packages/capturer/__init__.py", line 233, in __init__
    self.stdout_stream = self.initialize_stream(sys.stdout, STDOUT_FD)
  File "/Users/charles3/prog/venvs/vopu/lib/python3.5/site-packages/capturer/__init__.py", line 267, in initialize_stream
    real_fd = file_obj.fileno()
io.UnsupportedOperation: fileno

Version 3.0, with PyCharm 2020.1, and Python 3.5

I used instead py.io.StdCaptureFD, and it worked without error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions