Skip to content

also escape backslashes in quote_py_str()#3386

Merged
boegel merged 4 commits intoeasybuilders:developfrom
lexming:parsetest
Aug 9, 2020
Merged

also escape backslashes in quote_py_str()#3386
boegel merged 4 commits intoeasybuilders:developfrom
lexming:parsetest

Conversation

@lexming
Copy link
Copy Markdown
Contributor

@lexming lexming commented Jul 14, 2020

This PR enhances quote_py_str() to also escape all backslashes. Otherwise parse tests may fail due to divergences between the provided and dumped easyconfig. That's because quote_py_str() is limited to quotes and new lines, while several options such as preconfigopts, prebuildopts or postintallcmds can potentially contain any string literal.

This fixes the failed tests of easybuilders/easybuild-easyconfigs#10965

@lexming lexming added this to the 4.x milestone Jul 14, 2020
@lexming
Copy link
Copy Markdown
Contributor Author

lexming commented Jul 14, 2020

My initial approach with repr() did work with tests in test.easyconfigs.suite but it messed up some tests in test.framework.easyconfig. I now changed it by modifying quote_py_str() instead.

@lexming lexming changed the title use repr() to format extra keys in dumped v1 easyconfings Escape backslashes in quote_py_str() Jul 14, 2020
Comment thread easybuild/tools/utilities.py Outdated
@boegel boegel added bug fix and removed enhancement labels Aug 5, 2020
@boegel boegel modified the milestones: 4.x, next release (4.2.3?) Aug 5, 2020
@boegel boegel changed the title Escape backslashes in quote_py_str() also escape backslashes in quote_py_str() Aug 9, 2020
@boegel boegel merged commit f349f2b into easybuilders:develop Aug 9, 2020
@lexming lexming deleted the parsetest branch August 9, 2020 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants