Skip to content

Conversation

@adnandaut
Copy link

Side note:
I noticed that other places in the code use rstrip('\n').
But if an attached file acually ends with one or more line breaks, I think we want to leave them as they are and only remove the single trailing newline that the op cli tool adds as a convenience for interactive use in the shell.
For this, the method removesuffix, introduced in Python 3.9, is used instead of rstrip, which removes all trailing linebreaks.

Since I do not have enough context for the other usages of rstrip in the code, I can not say for certain, but I would think that they could also utilise removesuffix instead.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Using op.read() to pull the contents of a text file attached to an item only pulls the first line of the document

1 participant