0

I am trying to follow the steps at this article https://ruvi-d.medium.com/getting-zbarlight-to-work-on-windows-a3dc643dba18

At step 3 I got this desription

Apply this patch https://bugs.python.org/file40608/patch.diff to the cygwinccompiler.py file in the same folder

How to apply this patch? I have no idea how to perform such a step

YasserKhalil
  • 9,138
  • 7
  • 36
  • 95

1 Answers1

1

From the steps indicated I think you should open your terminal and follow theses steps :

  • First go in the folder indicated : cd <your_python_path>\Lib\distutils.
  • Second - according to the author of the article, a file named cygwinccompiler.py is supposed to be present, the patch is supposed to be applied on it.
  • Third download (or copy as you prefered) the patch file in the current directory, lets name the patch file patch.diff (for reminder here is its link https://bugs.python.org/file40608/patch.diff).
  • Then you must run :
pip install patch
python -m patch patch.diff

Since the name of the file to patch is present in patch.diff you do not have to precise the destination file.

jrobin
  • 26
  • 5
  • Thank you very much. I followed the steps you mentioned and encountered an error `C:\Users\Future\AppData\Local\Programs\Python\Python37\python.exe: Error while finding module specification for 'patch.diff' (ModuleNotFoundError: __path__ attribute not found on 'patch' while trying to find 'patch.diff')` – YasserKhalil Oct 01 '21 at 14:25
  • I've made a mistake, you should execute `python -m patch` instead of `python -m patch.diff` – jrobin Oct 01 '21 at 14:51
  • Thanks a lot. I used this line `python -m patch patch.diff` and worked as expected. I could copy and paste the lines with the blue plus but I prefered to do it through python to learn something new. – YasserKhalil Oct 01 '21 at 14:58
  • What does this line mean exactly `@@ -82,7 +82,18 @@ def get_msvcr():`. I could get 82 is the first line of the new patched data and the def get_Msvcr() is the function name .. what about 7 and 18? – YasserKhalil Oct 01 '21 at 15:57
  • 1
    You will find a good answer to this question here https://stackoverflow.com/a/29113646/12113368 – jrobin Oct 04 '21 at 08:45