--- Logging error in Loguru Handler #3 ---
Record was: {'elapsed': datetime.timedelta(seconds=62, microseconds=308763), 'exception': None, 'extra': {'task': 'clean-anime-series-list', 'session_id': None, 'task_id': '121378'}, 'file': (name='verbose_details.py', path='%USERPROFILE%\\github\\flexget\\flexget\\plugins\\operate\\verbose_details.py'), 'function': 'on_task_download', 'level': (name='VERBOSE', no=15, icon='?'), 'line': 36, 'message': 'Summary - Accepted: 0 (Rejected: 0 Undecided: 0 Failed:
0)', 'module': 'verbose_details', 'name': 'details', 'process': (id=9684, name='MainProcess'), 'thread': (id=9940, name='task_queue'), 'time': datetime(2019, 12, 30, 0, 33, 26, 805511, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=75600), 'E. South America Standard Time'))}
Traceback (most recent call last):
File "%USERPROFILE%\github\flexget\lib\site-packages\loguru\_handler.py", line 153, in emit
self._sink.write(str_record)
File "%USERPROFILE%\github\flexget\lib\site-packages\loguru\_file_sink.py", line 175, in write
self._initialize_file(rename_existing=True)
File "%USERPROFILE%\github\flexget\lib\site-packages\loguru\_file_sink.py", line 189, in _initialize_file
os.rename(new_path, renamed_path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: '%USERPROFILE%\\flexget\\flexget.log' -> '%USERPROFILE%\\flexget\\flexget.2019-12-28_19-13-58_544131.log'
--- End of logging error ---
Expected behaviour:
Logs to be properly rotated from
flexget.logtoflexget.log.1-9when reaching the criteriaActual behaviour:
Loguru tells it can't rotate
flexget.logbecause the file is supposedly in use by another application, copies it to the same folder appending a timestamp to the filename andflexget.logis neither erased nor updated.Steps to reproduce:
flexget.logclose to the 1MB rotation markLog:
(click to expand)
Additional information:
Checked
flexget.logwith LockHunter to find the culprit for the file being in use, and all it returned was thepythonw.exeinstance that's running Flexget