Edgewall Software
Modify

Opened 7 months ago

Closed 5 weeks ago

#13625 closed defect (fixed)

TypeError: sequence item 0: expected str instance, bytes found

Reported by: Dirk Stöcker Owned by: Jun Omae
Priority: normal Milestone: 1.6.1
Component: version control/changeset view Version: 1.6
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Fixed an error while rendering diff of a changeset if [trac] use_chunked_encoding disabled.

API Changes:
Internal Changes:

Description

When I call following URL https://software.rtcm-ntrip.org/changeset/10236/ntrip/trunk/BNC/src/src.pri?format=diff I get the mentioned error message.

This also happens when I deactivate all plugins.

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/trac/web/main.py", line 609, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python3.6/site-packages/trac/web/main.py", line 301, in dispatch
    raise e
  File "/usr/lib/python3.6/site-packages/trac/web/main.py", line 247, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python3.6/site-packages/trac/versioncontrol/web_ui/changeset.py", line 343, in process_request
    self._render_diff(req, filename, repos, data)
  File "/usr/lib/python3.6/site-packages/trac/versioncontrol/web_ui/changeset.py", line 689, in _render_diff
    output = ''.join(output)
TypeError: sequence item 0: expected str instance, bytes found

It is fixed by

  • versioncontrol/web_ui/changeset.py

    old new  
    686686        if Chrome(self.env).use_chunked_encoding:
    687687            length = None
    688688        else:
    689             output = ''.join(output)
     689            output = b''.join(output)
    690690            length = len(output)
    691691
    692692        req.send_response(200)

Similar URLs on a second Trac instance work, so maybe that needs postgres as database to fail?

Applying the change on the working system with sqlite3 database does no harm.

Attachments (0)

Change History (3)

comment:1 by Jun Omae, 7 months ago

Milestone: 1.6.1
Owner: set to Jun Omae
Status: newassigned

Good catch! That is raised while rendering content as diff format when [trac] use_chunked_encoding is disabled with Trac 1.6. The option is enabled by default since Trac 1.4.

comment:2 by Jun Omae, 7 months ago

Component: generalversion control/changeset view

comment:3 by Jun Omae, 5 weeks ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Fixed in [17776] and merged in [17777].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae 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.