Edgewall Software

Opened 10 years ago

Last modified 3 years ago

#9140 new defect

patch renderer should handle added binary files in GIT binary diffs

Reported by: Christian Boos Owned by:
Priority: normal Milestone: next-stable-1.2.x
Component: rendering Version: 0.12dev
Severity: minor Keywords: patch diff
Cc: Branch:
Release Notes:
API Changes:


2010-03-15 22:05:19,147 Trac[api] WARNING: HTML preview using <trac.mimeview.patch.PatchRenderer object at 0x2693850> failed (
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/mimeview/api.py", line 759, in render
    rendered_content, filename, url)
  File "build/bdist.linux-x86_64/egg/trac/mimeview/patch.py", line 51, in render
  File "build/bdist.linux-x86_64/egg/trac/mimeview/patch.py", line 118, in _diff_to_hdf
    oldrev, newrev = index_line.split()[-1].split('..')
ValueError: need more than 1 value to unpack)

for attachment:8216-textarea-resize-r8859.patch:ticket:8721.

This is an issue with GIT binary diffs: for a new binary there's a new file mode 100644 line, which is not currently expected by the code.

94	diff --git a/trac/htdocs/grip.png b/trac/htdocs/grip.png
95	new file mode 100644
96	index 0000000000000000000000000000000000000000..6524d4167d2d6e3939cfcf3111ce520acd66bc21
97	GIT binary patch
98	literal 162
99	zc%17D@N?(olHy`uVBq!ia0vp^(m>40!3-puuch|@DVB6cUq=Rp^(V|(yIunMk|nMY
100	zCBgY=CFO}lsSJ)O`AMk?p1FzXsX?iUDV2pMQ*D5X*aCb)TzBu@{r~^}iVZzqfg(&L
101	zL4Lvi8J=!8@B;EgJY5_^DsCku9AK6xWM-3k!OUU6z#qV1KKathOF(%BPgg&ebxsLQ
102	E0Ke)mAOHXW

Attachments (0)

Change History (3)

comment:1 by Ryan J Ollos, 5 years ago

Milestone: next-minor-0.12.xnext-stable-1.0.x

comment:2 by figaro, 4 years ago

Keywords: patch added

comment:3 by Ryan J Ollos, 3 years ago

Milestone: next-stable-1.0.xnext-stable-1.2.x

Moved ticket assigned to next-stable-1.0.x since maintenance of 1.0.x is coming to a close. Please move the ticket back if it's critical to fix on 1.0.x.

Modify Ticket

Change Properties
Set your email in Preferences
as new The ticket will remain with no owner.
The ticket will be disowned. Next status will be 'new'.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.