[asterisk-commits] staging_changes: Skip empty lines when parsing headers (repotools[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 23 09:45:58 CDT 2022


Kevin Harwell has submitted this change. ( https://gerrit.asterisk.org/c/repotools/+/18683 )

Change subject: staging_changes: Skip empty lines when parsing headers
......................................................................

staging_changes: Skip empty lines when parsing headers

When parsing headers there was a check in the code to skip new lines.
This caused a problem if a line contained only other whitespace. This
patch now skips lines that contain only whitespace or are essentially
empty.

Change-Id: I600e03cead6230fb8ce27abb586608d906312b4a
---
M staging_changes.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved; Approved for Submit



diff --git a/staging_changes.py b/staging_changes.py
index f471e7d..dc8adac 100644
--- a/staging_changes.py
+++ b/staging_changes.py
@@ -169,7 +169,7 @@
             subjects = []
             message = ""
             line = f.readline()
-            while line != "\n":
+            while line.strip(" \t\n\r"):
                 # Get the subjects as they appear
                 if line.startswith("Subject:"):
                     subject = line.split("Subject:")[1].strip()

-- 
To view, visit https://gerrit.asterisk.org/c/repotools/+/18683
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: repotools
Gerrit-Branch: master
Gerrit-Change-Id: I600e03cead6230fb8ce27abb586608d906312b4a
Gerrit-Change-Number: 18683
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20220623/be31a8aa/attachment.html>


More information about the asterisk-commits mailing list