Opened 11 years ago

Closed 11 years ago

#4854 closed (fixed)

backslashes not required on windows

Reported by: anonymous Owned by: nobody
Component: Documentation Version: master
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: UI/UX:


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:
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


Attachments (1)

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

Download all attachments as: .zip

Change History (7)

comment:1 Changed 11 years ago by Chris Beaven

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\to\here'

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

Resolution: invalid
Status: closedreopened

Replying to SmileyChris:

The reporter is recommending forward slashes, not unescaped backslashes.

comment:3 Changed 11 years ago by Chris Beaven

Triage Stage: UnreviewedDesign decision needed

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

Changed 11 years ago by Adam Vandenberg

Attachment: 4854.diff added

comment:4 Changed 11 years ago by Adam Vandenberg

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 Changed 11 years ago by Chris Beaven

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 Changed 11 years ago by Malcolm Tredinnick

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