git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] stg mail crashes when there is no patch description

From
ASAngus Salkeld <ahsalkeld@gmail.com>
Date
Feb 28, 2008, 23:14 UTC
Message-ID
<8daa1da0802281514wcaaafc0m436311f0046ba0c@mail.gmail.com>
stg mail crashes when there is no patch description
The error is:
File "/usr/lib/python2.4/site-packages/stgit/commands/mail.py", line
397, in __build_message
descr = p.get_description().strip()
AttributeError: 'NoneType' object has no attribute 'strip'

This patch tries to handle this a bit better by setting the description to "<empty message>" and forcing the edit_patches option on. ---

 stgit/commands/mail.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
index f12d694..63c4b39 100644
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py
@@ -393,7 +393,13 @@ def __build_message(tmpl, patch, patch_nr,
total_nr, msg_id, ref_id, options):
     """
     p = crt_series.get_patch(patch)

-    descr = p.get_description().strip()
+    if p.get_description():
+        descr = p.get_description().strip()
+    else:
+        # provide a place holder and force the edit message option on
+        descr = '<empty message>'
+        options.edit_patches = True
+
     descr_lines = descr.split('\n')

     short_descr = descr_lines[0].rstrip()
Message 1 of 1 in “stg mail crashes when there is no patch description”
  1. stg mail crashes when there is no patch descriptionAngus Salkeld, Feb 28, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.