Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

#8275 closed defect (fixed)

UnicodeEncodeError & IOError while using trac-admin init-env

Reported by: david.sillou@… Owned by: Christian Boos
Priority: high Milestone: 0.11.5
Component: admin/console Version: none
Severity: normal Keywords: unicode
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

After reinstalling trac with i10n catalogs (python ./setup.py compile_catalog -f then python setup.py bdist_egg then easy_install dist/Trac…egg) I'm not able to create trac envs anymore :

david@tornado:~$ trac-admin /var/www/vhosts/sillou.fr/private/tracs/leo initenv
/var/www/vhosts/sillou.fr/opt/lib/python2.6/site-packages
/TracAccountManager-0.2.1dev_r5479-py2.6.egg/acct_mgr/pwhash.py:13:
 DeprecationWarning: the md5 module is deprecated; use hashlib instead
/var/www/vhosts/sillou.fr/opt/lib/python2.6/site-packages
/TracAccountManager-0.2.1dev_r5479-py2.6.egg/acct_mgr/pwhash.py:13:
 DeprecationWarning: the sha module is deprecated; use the hashlib module instead
Création d'un nouvel environnement Trac à /var/www/vhosts/sillou.fr/private/tracs/leo

Trac va tout d'abord demander un certain nombre de questions concernant 
votre environnement de façon à pouvoir préparer la base de donnée du 
projet.

 Veuillez entrer le nom du projet.
 Ce nom sera utilisé dans les titres et descriptions de pages.

Nom du projet [My Project]> leo
 Veuillez spécifier la connection à la base de donnée qui devra être 
 utilisée. Par défaut, une base de donnée de type SQLite sera crée dans
 le répertoire correspondant à cet environnement. Il est également possible
 d'utiliser une base de donnée PostgreSQL (reportez-vous à la documentation
 de Trac pour connaître la syntaxe exacte)
UnicodeEncodeError: ('ascii', u'Connection \xe0 la base de donn\xe9es [sqlite:db/trac.db]>',
 11, 12, 'ordinal not in range(128)')
Erreur lors de l'ouverture de l'environnement. (2, 'No such file or directory')
Traceback (most recent call last):
  File "/var/www/vhosts/sillou.fr/opt/lib/python2.6/site-packages/Trac-0.12dev_r8183-py2.6.egg/
trac/admin/console.py", line 128, in env
    self.__env = Environment(self.envname)
  File "/var/www/vhosts/sillou.fr/opt/lib/python2.6/site-packages/Trac-0.12dev_r8183-py2.6.egg/
trac/env.py", line 208, in __init__
    self.verify()
  File "/var/www/vhosts/sillou.fr/opt/lib/python2.6/site-packages/Trac-0.12dev_r8183-py2.6.egg/
trac/env.py", line 267, in verify
    fd = open(os.path.join(self.path, 'VERSION'), 'r')
IOError: [Errno 2] No such file or directory: '/var/www/vhosts/sillou.fr/private/tracs/leo/VERSION'
david@tornado:~$

It worked pretty well before that : was using Trac-0.12dev_r81XX without catalogs compiled

PS: I hope I m not doing something wrong issuing this ticket; I did read the newTicketGuide and did search existing tickets.

Attachments (1)

t8275-raw_input-unicode-safe-r8176.patch (1.9 KB ) - added by Christian Boos 16 years ago.
proposed fix

Download all attachments as: .zip

Change History (8)

in reply to:  description comment:1 by Christian Boos, 16 years ago

Keywords: unicode added
Priority: normalhigh

Reproduced.

comment:2 by Christian Boos, 16 years ago

raw_input is not unicode safe.

by Christian Boos, 16 years ago

proposed fix

comment:3 by Christian Boos, 16 years ago

Owner: set to Christian Boos
Status: newassigned

Please try the above patch.

comment:4 by david.sillou@…, 16 years ago

it seems to fix the problem.

I m doing further testing right now.

Thank you very much.

comment:5 by david sillou <david.sillou@…>, 16 years ago

Resolution: fixed
Status: assignedclosed

I did finish the configuration of a new project in french.

All works now.

Changed to fixed (Hope I was supposed to)

Thanks again.

comment:6 by Remy Blank, 16 years ago

Resolution: fixed
Status: closedreopened

We only close tickets once the fix is applied in SVN.

comment:7 by Christian Boos, 16 years ago

Milestone: 0.120.11.5
Resolution: fixed
Status: reopenedclosed

I also added conversion of the input itself to unicode, so I backported the change to 0.11-stable (r8186), where this is useful as well.

Patch present in trunk as part of r8188.

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.