#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)
Change History (6)
by , 19 years ago
Attachment: | rawinput.1786.patch added |
---|
comment:1 by , 19 years ago
comment:4 by , 19 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Oops, this also happens for me!
oops, I meant strip(), not split(). Also what's with the empty attachments when I don't specify a file?