[Trac-tickets] [The Trac Project] #1664: trac_admin failing to read paths from console input on Windows

The Trac Project noreply at edgewall.com
Mon Jun 13 10:41:58 CDT 2005


#1664: trac_admin failing to read paths from console input on Windows
---------------------+------------------------------------------------------
       Id:  1664     |      Status:  new                     
Component:  general  |    Modified:  Mon Jun 13 10:41:57 2005
 Severity:  blocker  |   Milestone:  0.9                     
 Priority:  high     |     Version:  devel                   
    Owner:  jonas    |    Reporter:  anonymous               
---------------------+------------------------------------------------------
 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)

-- 
Ticket URL: <http://projects.edgewall.com/trac/ticket/1664>
The Trac Project <>


More information about the Trac-Tickets mailing list