Yedidyah Bar David has posted comments on this change. Change subject: core: filetransaction: Always add a newline ......................................................................
Patch Set 2: (1 comment) .................................................... File src/otopi/filetransaction.py Line 146: if self._content: Line 147: self._content += '\n' Line 148: else: Line 149: self._content = str(content) Line 150: if not self._content.endswith('\n'): Alon, you almost copied the code prior to the change (exactly copied, plus fixed the bug that creates empty files with a single newline (which I already encountered)). Did you understand what I want? I want to _always_ add the newline. Specifically, not only if self._content.endswith('\n') . Because a file with an empty last line will have content == [ ... 'line before last', '' ] and then _content will be '... \nline before last\n', so it will end with a newline, so we won't enter the if and not add another one, and loose the empty line. Line 151: self._content += '\n' Line 152: Line 153: self._mode = mode Line 154: self._dmode = dmode -- To view, visit http://gerrit.ovirt.org/18690 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I97f0feef1c003250c9f7453245f68398c64051cd Gerrit-PatchSet: 2 Gerrit-Project: otopi Gerrit-Branch: master Gerrit-Owner: Yedidyah Bar David <d...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Yedidyah Bar David <d...@redhat.com> Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches