Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix _processIncludes to take StringIO argument #1333

Merged
merged 5 commits into from
Jul 18, 2023

Conversation

opotowsky
Copy link
Member

@opotowsky opotowsky commented Jun 28, 2023

What is the change?

Added the capability for _processIncludes to handle StringIO input for src argument.

Why is the change being made?

resolveMarkupInclusions claims to handle StringIO and TextIOBase as inputs for the src, but _processIncludes only handled the scenario where there was a file path input.

This is discussed more in #1329.


Checklist

  • This PR has only one purpose or idea.
  • Tests have been added/updated to verify that the new/changed code works.
  • The release notes (location doc/release/0.X.rst) are up-to-date with any important changes.
  • The documentation is still up-to-date in the doc folder.
  • The dependencies are still up-to-date in setup.py.

@opotowsky
Copy link
Member Author

@john-science Here's the deal...

TextIOBase SHOULD in THEORY have a readlines attribute. I just couldn't figure out how to create a TextIOBase object in my code properly to test that. Which means the unit test I would add isn't going to work.

Yet?

BRB will work on this tomorrow :-)

@john-science john-science self-requested a review June 29, 2023 14:10
@john-science john-science added the bug Something is wrong: Highest Priority label Jun 29, 2023
@opotowsky opotowsky marked this pull request as ready for review July 14, 2023 19:22
@opotowsky opotowsky requested review from john-science and removed request for john-science July 14, 2023 19:22
@opotowsky
Copy link
Member Author

Ok this is ready for review now @john-science and can me merged at your leisure if you feel its ready

I think the TextIOBase case is quite limited because I couldn't figure out how to load the yaml into a bytesIO object into a TextIOBase or TextIOWrapper object to be used as input here. So I'm limiting this PR to the StringIO addition.

Copy link
Member

@john-science john-science left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@opotowsky opotowsky merged commit 06351ae into terrapower:main Jul 18, 2023
19 checks passed
@opotowsky opotowsky deleted the what-about-stringio branch July 18, 2023 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong: Highest Priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

resolveMarkupInclusions takes TextIOBase as input but can't take it all the way home
2 participants