January 18, 2012

Using patch

I got this error working on Google App Engine SDK 1.6.1 with Python 2.7.2 and trying to use Jinja2 on Windows:
WARNING  2012-01-18 23:09:40,239 py_zipimport.py:139] Can't open zipfile C:\dev\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg: IOError: [Errno 13] file not accessible: 'C:\\dev\\Python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg'

Comment 29 on this post suggested that I apply a patch. I downloaded the patch util and executed this command to apply the patch:
C:\Program Files (x86)\GnuWin32\bin>patch "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py" < "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.patch"


Howerver, I got this error:
patching file C:\Program Files (x86)\Google\google_appengine\google\appengine\tool\dev_appserver_import_hook.py
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354

This post suggested that I open the file in wordpad and save it using:
C:\Program Files (x86)\GnuWin32\bin>write "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.patch"

After that when I ran patch, it worked and I got this message:
patching file C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py
Hunk #1 succeeded at 257 (offset 7 lines).
Hunk #2 succeeded at 280 with fuzz 2 (offset 7 lines).

Although this did not fix my initial issue, I got to learn how to do a patch.

No comments: