Edgewall Software
Modify

Opened 11 years ago

Closed 11 years ago

#9914 closed defect (duplicate)

Using forward-slashes in path for log_file option on win32

Reported by: fbrettschneider@… Owned by: Remy Blank
Priority: normal Milestone:
Component: general Version: 0.12.1
Severity: normal Keywords:
Cc: Thijs Triemstra Branch:
Release Notes:
API Changes:
Internal Changes:

Description

As I set via Admin:General:Logging the following logfile name, I got a trac server error. The configuration is: Type=File, Log level=ERROR, Log file=

606/trac.log

The error is:

Internal Server Error

TracError: IOError: [Errno 2] No such file or directory: u'd:\\trac\\myproject\\log\\606/trac.log'

After I manually fixed my trac.ini, Trac worked again. The trac.ini contained this:

[logging]
log_file = 606/trac.log

My system is Bitnami-Trac 0.12.1, Native, Windows

Attachments (0)

Change History (5)

comment:1 by Remy Blank, 11 years ago

Well, yes, on Windows you have to use backslashes. This shouldn't be surprising.

Did you file a ticket because setting a bad log_file path prevents Trac from working? In that case, it's a duplicate of #8790.

Or was it because you expected forward slashes to be accepted even on Windows? That might be a sensible idea.

comment:2 by fbrettschneider@…, 11 years ago

I thought Trac doesn't care about slash or backslash. But I could live with it, if Trac didn't stop working. At least Trac should reject the path and tell me the path is wrong. Best case would be Trac can fix the path to backslashes by itself.

in reply to:  2 comment:3 by Remy Blank, 11 years ago

Milestone: 0.13
Owner: set to Remy Blank

Replying to fbrettschneider@…:

Best case would be Trac can fix the path to backslashes by itself.

Ok, let's do that. It can probably be done in PathOption.

comment:4 by Thijs Triemstra, 11 years ago

Cc: Thijs Triemstra added
Summary: relative path with slash + trac log filename leads to server error on Win32Using forward-slashes in path for log_file option on win32

Updating ticket summary to reflect request.

comment:5 by Remy Blank, 11 years ago

Milestone: 0.13
Resolution: duplicate
Status: newclosed

On second thought, I find the error message No such file or directory: u'd:\\trac\\myproject\\log\\606/trac.log' explicit enough, and it feels quite logical that you have to use the path separator for the platform running Trac. Modifying Trac to allow '/' everywhere even on Windows would be possible, but then one would expect this to be supported for all path options, including plugins. I don't think it's worth the trouble.

This leaves the "don't stop working" part, which is a duplicate of #8790.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.