Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#1161 closed defect (fixed)

make-messages.py fails in win32 for long folders

Reported by: hipertracker@… 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 hugo, 19 years ago

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

comment:2 by hugo, 19 years ago

Resolution: fixed
Status: newclosed

(In [1814]) fixes #1161 - spaces in filenames should now be handled better (filename parameters are enclosed in "")

comment:3 by hipertracker@…, 19 years ago

Keywords: unique-messages.py added; make-messages.py removed
Resolution: fixed
Status: closedreopened

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 hugo, 19 years ago

Resolution: fixed
Status: reopenedclosed

(In [1821]) fixes #1161 - added quotes to unique-messages.py

comment:5 by hugo, 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 Antonio Cavedoni, 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?

comment:7 by hugo, 19 years ago

ah, yes, that's possible. thx for the info.

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