Edgewall Software
Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#12661 closed defect (fixed)

Escape arguments for command line so spaces in paths are quoted

Reported by: anonymous Owned by: Ryan J Ollos
Priority: lowest Milestone: 1.0.14
Component: admin/console Version:
Severity: trivial Keywords: bitesized
Cc: Branch:
Release Notes:

Environment path is escaped in environment needs upgrade message.

API Changes:
Internal Changes:

Description (last modified by Jun Omae)

The hint in this error message is wrong:

Trac Error

TracError: The Trac Environment needs to be upgraded.

Run "trac-admin c:\Users\Mike\My Documents\TracEnv upgrade"

Running that command without quotes leads to this error:

Error: No Trac environment found at c:\users\mike\my

[Errno 2] No such file or directory: 'c:\users\mike\my\VERSION'

It should be:

Run 'trac-admin "c:\Users\Mike\My Documents\TracEnv" upgrade'

Attachments (0)

Change History (8)

comment:1 by Jun Omae, 7 years ago

Description: modified (diff)
Keywords: bitesized added
Milestone: unscheduled
Priority: normallowest
Severity: normaltrivial

comment:2 by Ryan J Ollos, 7 years ago

Milestone: unscheduled1.2.1
Owner: set to Ryan J Ollos
Status: newassigned

The change looks simple enough:

  • trac/env.py

    diff --git a/trac/env.py b/trac/env.py
    index 4213c7b6c..5d03e9902 100644
    a b def open_environment(env_path=None, use_cache=False):  
    939939                          exception_to_unicode(e, traceback=True))
    940940        if needs_upgrade:
    941941            raise TracError(_('The Trac Environment needs to be upgraded.\n\n'
    942                               'Run "trac-admin %(path)s upgrade"',
     942                              'Run \'trac-admin "%(path)s" upgrade\'',
    943943                              path=env_path))
    944944
    945945    return env

comment:3 by Ryan J Ollos, 7 years ago

Milestone: 1.2.11.0.14

comment:4 by Ryan J Ollos, 7 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed in [15654:15656].

comment:5 by Jun Omae, 7 years ago

The same issue exists at other locations. I noticed while checking output of make extract.

$ git grep -E 'trac-admin\s+%' mirror/1.0-stable -- '*.py'
mirror/1.0-stable:trac/admin/console.py:        printout(_("""Welcome to trac-admin %(version)s
mirror/1.0-stable:trac/admin/console.py:                              'Run "trac-admin %(path)s upgrade"',
mirror/1.0-stable:trac/env.py:                   "running:\n\n  trac-admin %(path)s wiki upgrade",
mirror/1.0-stable:trac/versioncontrol/admin.py:                        resync = tag.tt('trac-admin %s repository resync '
mirror/1.0-stable:trac/versioncontrol/admin.py:                            cset_added = tag.tt('trac-admin %s changeset '
mirror/1.0-stable:trac/versioncontrol/admin.py:                        resync = tag.tt('trac-admin %s repository resync '
mirror/1.0-stable:trac/versioncontrol/admin.py:                        cset_added = tag.tt('trac-admin %s changeset '
Last edited 7 years ago by Jun Omae (previous) (diff)

comment:6 by Ryan J Ollos, 7 years ago

Resolution: fixed
Status: closedreopened

comment:7 by Ryan J Ollos, 7 years ago

Resolution: fixed
Status: reopenedclosed

Thanks for spotting. Additional changes in [15683:15685].

comment:8 by Ryan J Ollos, 7 years ago

Additional change to reduce number of translatable strings by 1 in r16219, merged in r16221, r16223. Message extractions in r16220, r16222, r16224.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.