Patch

Latest version: v1.16

Safety actively analyzes 681812 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

11.01

- patch.py can read patches from web
- patch.py returns -1 if there were errors during patching
- store patch headers (necessary for future DIFF/SVN/HG/GIT detection)
- report about extra bytes at the end after patch is parsed
- API changes
+ fromurl()
* Patch.apply() now returns True on success

10.11

- fixed fromstring() failure due to invalid StringIO import (issue 9)
(thanks john.stumpo for reporting)
- added --verbose and --quiet options
- improved message logging
- change "successfully patched..." message to INFO instead of WARN
(thanks Alex Stewart for reporting and patch)
- skip __main__ imports when used as a library (patch by Alex Stewart)
- API changes
* renamed class HunkInfo to Hunk
+ Patch.type placeholder (no detection yet - parser is not ready)
+ constants for patch types DIFF/PLAIN, HG/MERCURIAL, SVN/SUBVERSION
+ Patch.header for saving headers which can be used later to extract
additional meta information such as commit message
- internal: improving parser speed by allowing blocks fetch lines on
demand
- test suite improvements

10.04

- renamed debug option to --debug
- API changes
* method names are now underscored for consistency with difflib
+ addded Patch.can_patch(filename) to test if source file is in list
of source filenames and can be patched
* use designated logger "python_patch" instead of default

9.082

- compatibility fix for Python 2.4

9.081

- fixed issue 2 - remove trailing whitespaces from filename
(thanks James from Twisted Fish)
- API changes
+ added Patch and HunkInfo classes
* moved utility methods into Patch
+ build Patch object by specifying stream to constructor
or use top level functions fromfile() and fromstring()
- added test suite

8.062

- compatibility fix for Python 2.4

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.