Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#740 closed defect (fixed)

translation middleware not working on win xp

Reported by: radek <translate@…> Owned by: Adrian Holovaty
Component: Core (Other) Version: 1.0
Severity: major Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


In there is used split('/') for splitting path. This does not work on Win systems.


Index: C:/Python24/Lib/site-packages/django/utils/
--- C:/Python24/Lib/site-packages/django/utils/	(revision 1092)
+++ C:/Python24/Lib/site-packages/django/utils/	(working copy)
@@ -338,7 +338,7 @@
                 # filename, because otherwise we might incorrectly
                 # report de_DE if we only have de available, but
                 # did find de_DE because of language normalization
-                lang = langfile[len(globalpath):].split('/')[1]
+                lang = langfile[len(globalpath):].split(os.path.sep)[1]
                 _accepted[accept] = lang
                 return lang

Btw. I have found use of split('/') in anothers files aswell:




Change History (2)

comment:1 Changed 13 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [1095]) Fixed #740 -- Abstracted hard-coded slash in utils/ Thanks, radek. Also cleaned up docstrings a bit.

comment:2 Changed 12 years ago by (none)

milestone: Version 1.0

Milestone Version 1.0 deleted

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