Skip to content

Crash on SVN-created patch with only one binary file changed #17

Open
@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Add new or change existing binary file in svn repository.
2. Create svn diff.
3. Try to parse/apply patch with patch.py 

What is the expected output? What do you see instead?
I would expect binary file to be copied over; at the very least - some warning 
that this case cannot be processed.
I actually get AttributeError: 'NoneType' object has no attribute 'hunks'" in 
either line 440 or 444, depending on debugmode setting value.


What version of the product are you using? On what operating system?
@146, python 2.6, Win and Mac.

Please provide any additional information below.
The issue is due to incorrect processing of header in this case - code after 
line 220 ("if headscan:") doesn't stop and treats this whole thing as a header 
without any additional parsing:

Index: bin.png

===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: bin.png


___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Original issue reported on code.google.com by azasyp...@gmail.com on 31 Mar 2011 at 8:07

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions