Django

Code

Ticket #1161 (closed: fixed)

Opened 3 years ago

Last modified 3 years ago

make-messages.py fails in win32 for long folders

Reported by: hipertracker@gmail.com Assigned to: hugo
Milestone: Component: Internationalization
Version: SVN Keywords: i18n, win32 unique-messages.py
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

Attachments

Change History

01/03/06 16:26:54 changed by hugo

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

01/03/06 16:29:58 changed by hugo

  • status changed from new to closed.
  • resolution set to fixed.

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

01/05/06 06:58:57 changed by hipertracker@gmail.com

  • keywords changed from i18n, win32 make-messages.py to i18n, win32 unique-messages.py.
  • status changed from closed to reopened.
  • resolution deleted.

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.

01/05/06 08:09:24 changed by hugo

  • status changed from reopened to closed.
  • resolution set to fixed.

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

01/05/06 08:11:41 changed by hugo

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

01/06/06 07:01:09 changed by verbosus

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?

01/06/06 08:39:32 changed by hugo

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


Add/Change #1161 (make-messages.py fails in win32 for long folders)




Change Properties
Action