Edgewall Software
Modify

Ticket #8180 (new defect)

Opened 17 months ago

Last modified 9 months ago

Bad encoding in mercurial plugin

Reported by: davojan@… Owned by: cboos
Priority: high Milestone: plugin - mercurial
Component: plugin/mercurial Version: none
Severity: major Keywords: unicode
Cc:

Description

In browse source I got an error UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 23: ordinal not in range(128) (see attached screenshot).

I've fixed the bug by changing tracext/hg/backend.py:647:

if f.startswith(d):

to

if unicode(f, "utf-8").startswith(d):

Attachments

trac-hg-bug.png (85.7 KB) - added by davojan@… 17 months ago.
Bug illustration
tracext-hg-backend.py.diff (868 bytes) - added by kim@… 10 months ago.
Small hack that made it work for me
tracext-hg-backend.py.latin-1.diff (2.9 KB) - added by anonymous 7 months ago.
This one worked for me

Change History

Changed 17 months ago by davojan@…

Bug illustration

comment:1 Changed 17 months ago by cboos

  • Keywords unicode added
  • Milestone set to not applicable

Thanks for the report.

For the fix, I'd rather change convert [dir,] from utf-8 to the encoding used for the repository file names (see #7799 and ticket:7160#comment:5).

Changed 10 months ago by kim@…

Small hack that made it work for me

comment:2 Changed 9 months ago by cboos

  • Milestone changed from not applicable to mercurial-plugin

Changed 7 months ago by anonymous

This one worked for me

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from cboos. Next status will be 'new'
The owner will be changed from cboos to anonymous. Next status will be 'assigned'
Author


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

 
Note: See TracTickets for help on using tickets.