Opened 14 years ago
Closed 14 years ago
#9914 closed defect (duplicate)
Using forward-slashes in path for log_file option on win32
Reported by: | 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 , 14 years ago
follow-up: 3 comment:2 by , 14 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.
comment:3 by , 14 years ago
Milestone: | → 0.13 |
---|---|
Owner: | set to |
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 , 14 years ago
Cc: | added |
---|---|
Summary: | relative path with slash + trac log filename leads to server error on Win32 → Using forward-slashes in path for log_file option on win32 |
Updating ticket summary to reflect request.
comment:5 by , 14 years ago
Milestone: | 0.13 |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
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.
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.