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

values passed to command line options lose line breaks #126

Open
t4k opened this issue Jan 29, 2019 · 2 comments
Open

values passed to command line options lose line breaks #126

t4k opened this issue Jan 29, 2019 · 2 comments

Comments

@t4k
Copy link

t4k commented Jan 29, 2019

I'm trying to pass a string with newlines into the command line option for filling the External-Description metadata element, formatted nicely in accordance with the spec (https://tools.ietf.org/html/rfc8493#section-2.2.2), but because of #19 back in 2014, these newlines are getting stripped out and I cannot have a nicely wrapped bag-info.txt file.

@mhucka
Copy link

mhucka commented Feb 2, 2019

It seems that the behavior of bagit.py is asymmetrical with respect to how it treats long tag lines: it handles folded lines when reading bag-info.txt, but it does not fold long lines when writing long tag values into bag-info.txt. This is hardwired into the function _make_tag_file(), which explicitly strips line endings from tag values before writing them (see line 1231).

@mhucka
Copy link

mhucka commented Feb 5, 2019

I just did a PR for changes that implement a new flag, --wrap. This change has been working for us in preliminary testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants