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

FileNotFoundError: [Errno 2] No such file or directory: '/tmp/file.png' #78

Open
diklimchuk opened this issue Nov 18, 2020 · 1 comment

Comments

@diklimchuk
Copy link

diklimchuk commented Nov 18, 2020

In command line mode trimage fails to handle files with the same name in different directory.
Sample structure:

_root
__one
___image.png
__two
___image.png

command: trimage -d root

Stacktrace:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/trimage/ThreadPool/ThreadPool.py", line 83, in execute
    return_value = self.callable(*self.arguments) #IGNORE:W0142
  File "/usr/local/lib/python3.9/site-packages/trimage/trimage.py", line 397, in compress
    remove(backupfullpath)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/image.png'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 950, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/site-packages/trimage/ThreadPool/ThreadPool.py", line 124, in run
    job.execute()
  File "/usr/local/lib/python3.9/site-packages/trimage/ThreadPool/ThreadPool.py", line 86, in execute
    logger.warning("A job in the ThreadPool raised an exception: ", excep)
  File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/logging/__init__.py", line 1446, in warning
    self._log(WARNING, msg, args, **kwargs)
  File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/logging/__init__.py", line 1577, in _log
    self.handle(record)
  File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/logging/__init__.py", line 1587, in handle
    self.callHandlers(record)
  File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/logging/__init__.py", line 1648, in callHandlers
    if record.levelno >= hdlr.level:
AttributeError: '_io.TextIOWrapper' object has no attribute 'level'

Setup: Mac OS, trimage 1.0.6

@fostimus
Copy link

Same problem here

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