Skip to content

[BUG] Intermittent ValueError: I/O operation on closed file #63

Closed

Description

Describe the bug
I'm occasionally seeing this at the end of running pytest. I'm not sure if this is reproducible outside of the unittests or if the unittests are simply doing something weird.

Traceback (most recent call last):
  File "/home/dagardner/work/morpheus/morpheus/utils/logging.py", line 47, in emit
    click.echo(click.style(msg, **color_kwargs), file=file, err=is_error)
  File "/home/dagardner/work/conda/envs/morpheus/lib/python3.8/site-packages/click/utils.py", line 299, in echo
    file.write(out)  # type: ignore
Traceback (most recent call last):
ValueError: I/O operation on closed file.
  File "/home/dagardner/work/morpheus/morpheus/utils/logging.py", line 47, in emit
    click.echo(click.style(msg, **color_kwargs), file=file, err=is_error)
  File "/home/dagardner/work/conda/envs/morpheus/lib/python3.8/site-packages/click/utils.py", line 299, in echo
    file.write(out)  # type: ignore
Call stack:
ValueError: I/O operation on closed file.
Call stack:
  File "/home/dagardner/work/conda/envs/morpheus/lib/python3.8/threading.py", line 890, in _bootstrap
    self._bootstrap_inner()
  File "/home/dagardner/work/conda/envs/morpheus/lib/python3.8/threading.py", line 890, in _bootstrap
    self._bootstrap_inner()
  File "/home/dagardner/work/conda/envs/morpheus/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/dagardner/work/conda/envs/morpheus/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/dagardner/work/conda/envs/morpheus/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/dagardner/work/conda/envs/morpheus/lib/python3.8/logging/handlers.py", line 1487, in _monitor
    self.handle(record)
  File "/home/dagardner/work/conda/envs/morpheus/lib/python3.8/logging/handlers.py", line 1468, in handle
    handler.handle(record)
  File "/home/dagardner/work/conda/envs/morpheus/lib/python3.8/logging/__init__.py", line 954, in handle
    self.emit(record)
  File "/home/dagardner/work/morpheus/morpheus/utils/logging.py", line 53, in emit
    self.handleError(record)
  File "/home/dagardner/work/conda/envs/morpheus/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/dagardner/work/conda/envs/morpheus/lib/python3.8/logging/handlers.py", line 1487, in _monitor
    self.handle(record)
  File "/home/dagardner/work/conda/envs/morpheus/lib/python3.8/logging/handlers.py", line 1468, in handle
    handler.handle(record)
  File "/home/dagardner/work/conda/envs/morpheus/lib/python3.8/logging/__init__.py", line 954, in handle
    self.emit(record)
  File "/home/dagardner/work/morpheus/morpheus/utils/logging.py", line 53, in emit
    self.handleError(record)
Message: '====Pipeline Complete===='
Arguments: None
Message: '====Pipeline Complete===='
Arguments: None

Steps/Code to reproduce bug
Run pytest about 10 times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions