Modify ↓
Opened 13 months ago
Last modified 6 months ago
#13796 assigned defect
Exception in diff view
| Reported by: | Dirk Stöcker | Owned by: | Jun Omae |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.6.1 |
| Component: | general | Version: | 1.6 |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
As I now grep the log for ValueError for #13792 following came up:
2024-10-12 05:15:10,605 Trac[api] WARNING: HTML preview using PatchRenderer with <RenderingContext <Resource 'ticket:15802, attachment:circular_building_tool_3.patch'>> failed:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/trac/mimeview/api.py", line 810, in render
result = renderer.render(context, full_mimetype,
File "/usr/local/lib/python3.10/dist-packages/trac/mimeview/patch.py", line 51, in render
changes = self._diff_to_hdf(content.splitlines(),
File "/usr/local/lib/python3.10/dist-packages/trac/mimeview/patch.py", line 113, in _diff_to_hdf
oldpath, newpath = diffcmd_line.split()[-2:]
ValueError: not enough values to unpack (expected 2, got 1)
Happens when calling: https://josm.openstreetmap.de/attachment/ticket/15802/circular_building_tool.patch
Seems the code assumes something about the diff which isn't true. Didn't investigate further.
Attachments (0)
Change History (3)
comment:1 by , 13 months ago
| Summary: | Exception in diff viw → Exception in diff view |
|---|
comment:2 by , 13 months ago
| Milestone: | → 1.6.1 |
|---|---|
| Owner: | set to |
| Status: | new → assigned |
Note:
See TracTickets
for help on using tickets.



It seems to be caused by the process for
GIT binary patchin the diff file.trac/mimeview/patch.py
line = next(lines)