Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

#3018 closed defect (fixed)

trac-admin hotcopy broken, unicode related problem

Reported by: sam@… Owned by: Christian Boos
Priority: normal Milestone: 0.10
Component: admin/console Version: devel
Severity: major Keywords: trac-admin unicode hotcopy
Cc: sam@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Running trac-admin hotcopy fails with the following error :

Command failed: unicode() argument 2 must be string, not None

Trac trunk/, fresh update.

Attachments (0)

Change History (7)

comment:1 by Christian Boos, 19 years ago

Milestone: 0.10
Owner: changed from daniel to Christian Boos
Priority: lownormal

Probably sys.stdin.encoding which is None for you.

Can you try this patch?

Index: admin.py
===================================================================
--- admin.py	(revision 3118)
+++ admin.py	(working copy)
@@ -90,7 +90,7 @@
         """`line` may be a `str` or an `unicode` object"""
         try:
             if isinstance(line, str):
-                line = unicode(line, sys.stdin.encoding)
+                line = util.to_unicode(line, sys.stdin.encoding)
             rv = cmd.Cmd.onecmd(self, line) or 0
         except SystemExit:
             raise

comment:2 by sam@…, 19 years ago

Works like a charm.

comment:3 by Christian Boos, 19 years ago

Well, can you also try to create a new Milestone using trac-admin, "avé les assents" :)

I suspect there could be a problem there if sys.stdin.encoding is not known. It could then be worth to print a warning.

(+ what's your python version/platform?)

comment:4 by sam@…, 19 years ago

Creating a milestone with an accent worked without warnings (in interactive mode).

Python 2.3.5 (#2, Mar  6 2006, 10:12:24) 
[GCC 4.0.3 20060304 (prerelease) (Debian 4.0.2-10)] on linux2
Linux frog 2.6.11-grsec #3 Sun Mar 6 20:05:04 CET 2005 i686 GNU/Linux

comment:5 by Christian Boos, 19 years ago

OK, and in Trac, the accent shows up correctly?

comment:6 by sam@…, 19 years ago

Affirmative!

comment:7 by Christian Boos, 19 years ago

Resolution: fixed
Status: newclosed

Also fixed by mgood in r3140 in order to solve #3030.

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.