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

TimedRotatingFileHandler crashes on backup file deletion attempt #47178

Closed
blocki mannequin opened this issue May 20, 2008 · 2 comments
Closed

TimedRotatingFileHandler crashes on backup file deletion attempt #47178

blocki mannequin opened this issue May 20, 2008 · 2 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@blocki
Copy link
Mannequin

blocki mannequin commented May 20, 2008

BPO 2929
Nosy @vsajip

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/vsajip'
closed_at = <Date 2008-05-20.15:43:08.795>
created_at = <Date 2008-05-20.12:34:09.194>
labels = ['library', 'type-crash']
title = 'TimedRotatingFileHandler crashes on backup file deletion attempt'
updated_at = <Date 2008-05-20.15:43:08.794>
user = 'https://bugs.python.org/blocki'

bugs.python.org fields:

activity = <Date 2008-05-20.15:43:08.794>
actor = 'vinay.sajip'
assignee = 'vinay.sajip'
closed = True
closed_date = <Date 2008-05-20.15:43:08.795>
closer = 'vinay.sajip'
components = ['Library (Lib)']
creation = <Date 2008-05-20.12:34:09.194>
creator = 'blocki'
dependencies = []
files = []
hgrepos = []
issue_num = 2929
keywords = []
message_count = 2.0
messages = ['67125', '67131']
nosy_count = 2.0
nosy_names = ['vinay.sajip', 'blocki']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue2929'
versions = ['Python 2.5']

@blocki
Copy link
Mannequin Author

blocki mannequin commented May 20, 2008

Hello,
when the maximum number of backup files is reached
TimedRotatingFileHandler can't delete the oldest existing file. I got
the following error message:

Traceback (most recent call last):
  File "D:\Python25\lib\logging\handlers.py", line 75, in emit
    self.doRollover()
  File "D:\Python25\lib\logging\handlers.py", line 319, in doRollover
    os.remove(s)
WindowsError: [Error 2] The system cannot find the file specified:
'assyst.log.2008-05-20_12-49'

The reason for this error is located in the getFilesToDelete method of
the TimedRotatingFileHandler class. The result sequence of this method
contains filenames but a complete filepath is needed.

After replacing
result.append(fileName)
with
result.append(os.path.join(dirName, fileName))
the problem seems to be solved

Regards
Stephan

@blocki blocki mannequin added stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump labels May 20, 2008
@vsajip
Copy link
Member

vsajip commented May 20, 2008

Fix checked into trunk (r63507). Thanks for the report!

@vsajip vsajip closed this as completed May 20, 2008
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

1 participant