Opened 17 years ago

Closed 17 years ago

#4854 closed (fixed)

backslashes not required on windows

Reported by: anonymous Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords: path backslash
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

apache installation manual says
If you’re using Windows, remember that the path will contain backslashes. This string is passed through Python’s string parser twice, so you need to escape each backslash twice:

PythonPath "c:\\\\path\\\\to\\\\project + sys.path"

Or, use raw strings:

PythonPath "[r'c:
path
to
project'] + sys.path"

but forward slashes work just fine here on windows and is less confusing than

, just remind them that forward slashes are preferred and to not try to figure out the

pattern.

Attachments (1)

4854.diff (838 bytes ) - added by Adam Vandenberg 17 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Chris Beaven, 17 years ago

Resolution: invalid
Status: newclosed

Assuming that the string is parsed twice, you should be double-escaping your path. It may just be coincidence that you haven't caused an error because you aren't using escapable characters.

For example, c:\path\here would be fine, but c:\path\to\here wouldn't be.

>>> 'c:\path\here'
'c:\\path\\here'
>>> 'c:\path\to\here'
'c:\\path\to\\here'

in reply to:  1 comment:2 by John Shaffer <jshaffer2112@…>, 17 years ago

Resolution: invalid
Status: closedreopened

Replying to SmileyChris:

The reporter is recommending forward slashes, not unescaped backslashes.

comment:3 by Chris Beaven, 17 years ago

Triage Stage: UnreviewedDesign decision needed

John, so they are. I'll promote do Design Decision

by Adam Vandenberg, 17 years ago

Attachment: 4854.diff added

comment:4 by Adam Vandenberg, 17 years ago

Has patch: set

Forward slashes are expected on Windows for Apache's built-in directives, so it makes sense to recommend them here as well.

comment:5 by Chris Beaven, 17 years ago

Triage Stage: Design decision neededReady for checkin

Elsewhere (settings) we recommend using forward slashes, so I guess we should do that everywhere. Simple is good.

comment:6 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: reopenedclosed

(In [6536]) Fixed #4854 -- Recommended the use of forward slashes even in Windows configuration, to avoid having to worry about double-escaping issues. Based on a patch from adamv.

Note: See TracTickets for help on using tickets.
Back to Top