Modify

Opened 17 years ago

Closed 12 years ago

#1719 closed defect (wontfix)

Encoding trouble

Reported by: anonymous Owned by: jmt4b04d4v
Priority: normal Component: TracSpanishTranslation
Severity: normal Keywords: UnicodeDecodeError
Cc: Trac Release: 0.10

Description (last modified by Ryan J Ollos)

Encoding trouble with the applying of the patch in the authentication process. The backtrace is the following:

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 406, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 259, in dispatch
    raise HTTPInternalError(e.message)
  File "/usr/lib/python2.4/site-packages/trac/web/api.py", line 47, in __call__
    Exception.__init__(self, '%s %s (%s)' % (self.code, self.reason,
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 12: ordinal not in range(128)

in the login module. This happen with many exceptions. using Trac 0.10.4

Attachments (0)

Change History (10)

comment:1 in reply to:  description Changed 17 years ago by jmt4b04d4v

Keywords: needinfo added

Replying to anonymous:

Encoding trouble with the applying of the patch in the authentication process. The backtrace is the following:
...

Strange, file is encoded in UTF-8 (as I already had encoding problems prior to submit first revision of patch file), I'll take a look, thanks for reporting.

...
in the login module. This happen with many exceptions. using Trac 0.10.4

Are you applying patch to Trac 0.10.4 release? (maybe trac-0.10.4 r5236).

Patch was created for current 0.10-stable branch (started at Trac 0.10.5dev r5702, changes up to r5644) and will be maintained for that target only.

Taking a look at Changes from tags/trac-0.10.4 at r5236 to branches/0.10-stable at r5803, chances are that patch won't apply correctly to Trac 0.10.4 release.

Could you try with Trac 0.10 stable branch? (get a working copy and apply patch to that).

As for now, I'd suggest to work (get a working copy) in a linux box. A windows subversion client will complain when applying patch (EOLs).

comment:2 Changed 17 years ago by jmt4b04d4v

Today I tested latest patches (python and templates r2343) against Trac 0.10-stable r5822:

root@PCDCOM:/home/jmtaboadav/tmpTrac/tmpTracSp# svn info
Path: .
URL: https://svn.edgewall.com/repos/trac/branches/0.10-stable
Repository Root: https://svn.edgewall.com/repos/trac
Repository UUID: af82e41b-90c4-0310-8c96-b1721e28e2e2
Revision: 5822
Node Kind: directory
Schedule: normal
Last Changed Author: cboos
Last Changed Rev: 5644
Last Changed Date: 2007-06-08 07:33:12 -0400 (Fri, 08 Jun 2007)
root@PCDCOM:/home/jmtaboadav/tmpTrac/tmpTracSp# svn info ../tmpTracTr/tracspanishtranslation/
Path: ../tmpTracTr/tracspanishtranslation
URL: https://trac-hacks.org/svn/tracspanishtranslation
Repository Root: https://trac-hacks.org/svn
Repository UUID: 7322e99d-02ea-0310-aa39-e9a107903beb
Revision: 2447
Node Kind: directory
Schedule: normal
Last Changed Author: jmt4b04d4v
Last Changed Rev: 2343
Last Changed Date: 2007-06-26 18:35:15 -0400 (Tue, 26 Jun 2007)

And found no problem. I will post patch procedure in TracSpanishTranslation? soon to avoid confusion.

Trac Team is currently busy with 0.11 release, and 0.10.5 is planned for No date set so I'm going to create patches for 0.10.4 release (trac-0.10.4 r5236). Wait for them.

comment:3 in reply to:  description ; Changed 17 years ago by jmt4b04d4v

Keywords: UnicodeDecodeError added; needinfo removed
Status: newassigned

Replying to anonymous:

Encoding trouble with the applying of the patch in the authentication process. The backtrace is the following:

Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 406, in dispatch_request

dispatcher.dispatch(req)

File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 259, in dispatch

raise HTTPInternalError(e.message)

File "/usr/lib/python2.4/site-packages/trac/web/api.py", line 47, in call

Exception.init(self, '%s %s (%s)' % (self.code, self.reason,

UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 12: ordinal not in range(128)

in the login module. This happen with many exceptions. using Trac 0.10.4

You were right all the time, I found another errors related with UnicodeEncodeError, it seems that some strings are not handled as unicode in Trac internals.

I'm going to search another potential troubles related with UnicodeDecodeError. At least 3 more bugs were found related with the same issue.

Thanks again for reporting!

comment:4 in reply to:  3 Changed 17 years ago by jmt4b04d4v

Replying to jmt4b04d4v:

You were right all the time, I found another errors related with UnicodeEncodeError, it seems that some strings are not handled as unicode in Trac internals.

Mmmm, certainly, I'm still a Python newbie, ... I've just learn how to manipulate string conversion in Python (related to Unicode).

There are places where I must do an explicit unicode transformation, that I missed. It's not handled in Trac internals because I'm the one who has introduced non-ascii characteres in Python code.

I'm going to search another potential troubles related with UnicodeDecodeError. At least 3 more bugs were found related with the same issue.

Indeed, found 8 bugs (included reported one) until found root of problems, all related with string interpolation within my non-ascii introduced strings.

Work in progress...

comment:5 Changed 17 years ago by Christian Boos

See also #T5684

comment:6 Changed 17 years ago by jmt4b04d4v

Resolution: fixed
Status: assignedclosed

(In [2461]) closes #1719: Encoding trouble

  • Added string manipulation of Unicode strings everywhere I introduced non-ascii characteres:
    • unicode($UNICODE_STRING, 'utf-8') - in strings that appear in the web UI.
    • unicode($CADENA_UNICODE, 'utf-8').encode('utf-8') - in strings that go to the STDOUT, for tracd and trac-admin (this doen't work really, I don't know why).
  • Fix some miss-translations:
    • 0.10-stable/trac/ticket/web_ui.py#L416
      • by - por
    • 0.10-stable/trac/Timeline.py#L195
      • RSS Feed - Fuente en formato RSS
    • 0.10-stable/templates/newticket.cs#L10
      • Crer - Crear
    • 0.10-stable/templates/newticket.cs#L22
      • Breve descripci?\195?\179n - Descripci?\195?\179n breve
    • 0.10-stable/templates/about.cs#L91 , 0.10-stable/trac/env.py#L83
      • open source - c?\195?\179digo abierto
    • 0.10-stable/templates/changeset.cs#L135
      • from - de
    • 0.10-stable/templates/changeset.cs#L180
      • added - a?\195?\177adido
    • 0.10-stable/templates/changeset.cs#L182
      • deleted - eliminado
    • 0.10-stable/templates/changeset.cs#L184
      • copied - copiado
    • 0.10-stable/templates/changeset.cs#L186
      • moved - movido
    • 0.10-stable/templates/changeset.cs#L188
      • modified - modificado

comment:7 in reply to:  5 ; Changed 17 years ago by anonymous

Replying to cboos:

See also #T5684

Thanks for feedback. I read this late and took a larger way.

comment:8 in reply to:  7 Changed 17 years ago by jmt4b04d4v

Replying to anonymous:

Replying to cboos:

See also #T5684

Thanks for feedback. I read this late and took a larger way.

Forgot to login, just for clarifying.

comment:9 Changed 17 years ago by rperezm@…

Resolution: fixed
Status: closedreopened

When the patch for Trac 0.10.4 will be available ?

comment:10 Changed 12 years ago by Ryan J Ollos

Description: modified (diff)
Resolution: wontfix
Status: reopenedclosed

Deprecated. See Trac 0.12 if you need a translation.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain jmt4b04d4v.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.