Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

#5067 closed defect (fixed)

Failed to create environment. 'unicode' object has no attribute 'decode'

Reported by: cyrano423@… Owned by: Christian Boos
Priority: highest Milestone: 0.10.4
Component: admin/console Version: devel
Severity: blocker Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I attempted to upgrade from 0.10.3 stable to the latest 0.10.4dev branch. Running:

trac-admin [projenv_path] upgrade

However, that failed. So I attempted to initialize a new environment:

trac-admin [projenv_path] initenv

which also failed. I then attempted to do a clean install of 0.10.4dev. No dice. Then, converted the MySQL database:

mysql> ALTER DATABASE trac DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

Confirmed it with:

mysql> use trac
mysql> SHOW VARIABLES LIKE '%character%';

Each time the error message was the same. The output is:

Creating and Initializing Project
Failed to create environment. 'unicode' object has no attribute 'decode'
Traceback (most recent call last):
  File "/home/inalias/packages/lib/python2.3/site-packages/trac/scripts/admin.py", line 613, in do_initenv
    options=options)
  File "/home/inalias/packages/lib/python2.3/site-packages/trac/env.py", line 145, in __init__
    self.create(options)
  File "/home/inalias/packages/lib/python2.3/site-packages/trac/env.py", line 250, in create
    DatabaseManager(self).init_db()
  File "/home/inalias/packages/lib/python2.3/site-packages/trac/db/api.py", line 69, in init_db
    connector, args = self._get_connector()
  File "/home/inalias/packages/lib/python2.3/site-packages/trac/db/api.py", line 85, in _get_connector
    scheme, args = _parse_db_str(self.connection_uri)
  File "/home/inalias/packages/lib/python2.3/site-packages/trac/db/api.py", line 144, in _parse_db_str
    user = unicode_unquote(user)
  File "/home/inalias/packages/lib/python2.3/site-packages/trac/util/text.py", line 75, in unicode_unquote
    return unquote(value).decode('utf-8')
AttributeError: 'unicode' object has no attribute 'decode'
Failed to initialize environment. 1
Traceback (most recent call last):
  File "/home/inalias/packages/lib/python2.3/site-packages/trac/scripts/admin.py", line 617, in do_initenv
    sys.exit(1)
SystemExit: 1

Thank you very much for your time.

Attachments (0)

Change History (5)

comment:1 by cyrano423@…, 17 years ago

Priority: normalhighest

Reinstalled everything from scratch (trac, clearsilver, subversion, mysql-python, etc) and the error output is the same. For now I've disabled the trac server as when loading the page 'cgitb' prints out the database username and password.

comment:2 by Christian Boos, 17 years ago

Owner: changed from Christopher Lenz to Christian Boos
Status: newassigned

#5069 describes another symptom of this problem. The problem was introduced in r5136 which assumed that the db string should be an unicode string. I have to check why it isn't actually an unicode string, as that string is coming straight from the config options and therefore should be unicode…

comment:3 by Christian Boos, 17 years ago

Woops, the problem was rather me not reading the API doc for the unicode_unquote method ;-)

comment:4 by Prasand J. <cyrano423@…>, 17 years ago

Thank you very much for looking into this. I truly appreciate it.

comment:5 by Christian Boos, 17 years ago

Resolution: fixed
Status: assignedclosed

Fixed by r5162 (trunk) and r5163 (0.10-stable), thanks for the report!

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.