#1161 closed defect (fixed)
make-messages.py fails in win32 for long folders
Reported by: | Owned by: | hugo | |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | critical | Keywords: | i18n, win32 unique-messages.py |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The script make-messages.py does not work for long folders (containing spaces) in win32
SOLUTION:
For win32:
stdin, stdout, stderr) = os.popen3('msguniq %s' % potfile, 'b')
should be changed to:
if sys.platform == 'win32': stdin, stdout, stderr) = os.popen3('msguniq "%s"' % potfile, 'b')
and
(stdin, stdout, stderr) = os.popen3('msgmerge -q %s %s' % (pofile, potfile), 'b')
should be changed to:
if sys.platform == 'win32': (stdin, stdout, stderr) = os.popen3('msgmerge -q "%s" "%s"' % (pofile, potfile), 'b')
Change History (7)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 19 years ago
Keywords: | unique-messages.py added; make-messages.py removed |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
The same problem is also in unique-messages.py file.
Change
cmd = 'msguniq %s.po' % pf
to
cmd = 'msguniq "%s.po"' % pf
And this is not problem o Python modules o course.
comment:4 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:5 by , 19 years ago
I'm still interested on where you get spaces in filenames within your Django project.
Oh, and the unique-messages.py is usually only needed by devs managing branches. No need for normal users to make use of it (it's there to handle a special case of problem that happens when merging .po files between branches).
comment:6 by , 19 years ago
Since on lines 15 and 17 in source:/django/trunk/django/bin/make-messages.py we’re calling:
os.path.abspath(…)
Maybe he’s getting spaces from his own “C:\Documents and Settings\…” directory?
Uh - where do you get paths with spaces in them? Python module paths should never contain spaces, and the templates are usually just stored within the project path. Makes me really wonder where the space comes in. Actually the problem isn't just with Windows - it's a common problem with constructing command lines when spaces in filenames come into play, but the situation where this happens shouldn't have spaces, that's why I am curious :-)