Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

Last modified 15 years ago

#1664 closed defect (fixed)

trac_admin failing to read paths from console input on Windows

Reported by: anonymous Owned by: Christian Boos
Priority: high Milestone: 0.9
Component: general Version: devel
Severity: blocker Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

On Windows 200, using trunk revision 1786 / python 2.3.5, trac-admin fails when inputting template dir location:

Templates directory [C:\Python23\share\trac\templates]> (the correct dir) doesn't look like a Trac templates directory Trac [F:\SVN\test-trac.db]>

If I put the following line in scripts/admin.py at line #558:

else:

project_name, db_str, repository_dir, templates_dir = arg[:4]

# I ADDED THIS LINE:—————————— print ((project_name, db_str, repository_dir, templates_dir))

and repeat trac-admin, I get this:

Templates directory [C:\Python23\share\trac\templates]> ('\r', '\r', 'F:/SVN/PROJECTS\r', '\r') doesn't look like a Trac templates directory Trac [F:\SVN\test-trac.db]>

It looks like raw_input is appending \r onto everything and the real path is getting lost, also the \r is messing with os.path.join().

If I put .split() after all the raw_input() calls in get_initenv_args() it seems to fix the problem. for example

#returnvals.append(raw_input('Project Name [%s]> ' % dp) or dp) returnvals.append(raw_input('Project Name [%s]> ' % dp).strip() or dp)

Attachments (1)

rawinput.1786.patch (1.7 KB ) - added by anonymous 19 years ago.

Download all attachments as: .zip

Change History (6)

by anonymous, 19 years ago

Attachment: rawinput.1786.patch added

comment:1 by anonymous, 19 years ago

oops, I meant strip(), not split(). Also what's with the empty attachments when I don't specify a file?

comment:2 by Ivo Looser, 19 years ago

this patch works also on my Windows machine with python 2.3

comment:3 by Shun-ichi Goto <gotoh@…>, 19 years ago

This is same to #1723.

comment:4 by Christian Boos, 19 years ago

Owner: changed from Jonas Borgström to Christian Boos
Status: newassigned

Oops, this also happens for me!

comment:5 by Christian Boos, 19 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r1929

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos 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.