Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#740 closed defect (fixed)

translation middleware not working on win xp

Reported by: radek <translate@…> Owned by: adrian
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: UI/UX:


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 10 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:2 Changed 9 years ago by anonymous

  • milestone Version 1.0 deleted

Milestone Version 1.0 deleted

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