Skip to content

oletools/olevba.py: Fix deprecation warnings - #888

Open
leon-anavi wants to merge 1 commit into
decalage2:masterfrom
leon-anavi:leon/fix-deprecation-warnings
Open

leon-anavi wants to merge 1 commit into
decalage2:masterfrom
leon-anavi:leon/fix-deprecation-warnings

Conversation

@leon-anavi

Copy link
Copy Markdown

Replace deprecated PyParsing APIs with their current equivalents: enablePackrat -> enable_packrat, setParseAction -> set_parse_action, escQuote -> esc_quote, initChars/bodyChars -> init_chars/body_chars, infixNotation -> infix_notation, scanString -> scan_string.

Fixes:

PyparsingDeprecationWarning: 'enablePackrat' deprecated - use 'enable_packrat'
PyparsingDeprecationWarning: 'setParseAction' deprecated - use 'set_parse_action'
PyparsingDeprecationWarning: 'escQuote' argument is deprecated, use 'esc_quote'
PyparsingDeprecationWarning: 'initChars' argument is deprecated, use 'init_chars'
PyparsingDeprecationWarning: 'infixNotation' deprecated - use 'infix_notation'
PyparsingDeprecationWarning: 'scanString' deprecated - use 'scan_string'

Replace deprecated PyParsing APIs with their current equivalents:
enablePackrat -> enable_packrat, setParseAction -> set_parse_action,
escQuote -> esc_quote, initChars/bodyChars -> init_chars/body_chars,
infixNotation -> infix_notation, scanString -> scan_string.

Fixes:

PyparsingDeprecationWarning: 'enablePackrat' deprecated - use 'enable_packrat'
PyparsingDeprecationWarning: 'setParseAction' deprecated - use 'set_parse_action'
PyparsingDeprecationWarning: 'escQuote' argument is deprecated, use 'esc_quote'
PyparsingDeprecationWarning: 'initChars' argument is deprecated, use 'init_chars'
PyparsingDeprecationWarning: 'infixNotation' deprecated - use 'infix_notation'
PyparsingDeprecationWarning: 'scanString' deprecated - use 'scan_string'

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
@danielhav

Copy link
Copy Markdown

This misses bumping the requirement in setup.py. With the older pyparsing versions this would no longer work. I've already filed a PR for this months ago, see #877

@leon-anavi

Copy link
Copy Markdown
Author

This misses bumping the requirement in setup.py. With the older pyparsing versions this would no longer work. I've already filed a PR for this months ago, see #877

Sorry, I've missed your #877. Just to provide more context on my work, I ran into this while enabling tests for oletools in layer meta-openembedded which in a nutshell is used with the Yocto Project and OpenEmbedded for building custom embedded Linux distributions. I tested it on Raspberry Pi. Within this setup the dependencies are managed differently and we have there the required new pyparsing version. Here is my patch which has been merged in the upstream of meta-openembedded/meta-python:
https://git.openembedded.org/meta-openembedded/commit/?id=3d2279ddbadbe16c4ef85abfe0c0194b2a4dddc3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants