emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: "Dr. Arne Babenhauserheide" <arne_bab@web.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: [patch] fix: ox-rss died when an entry had an empty date [ ( @ /home/arne/.guix-profile/share/emacs/site-lisp/)]
Date: Sun, 10 Jan 2021 23:08:02 GMT	[thread overview]
Message-ID: <87k0skpezy.fsf@kyleam.com> (raw)
In-Reply-To: <875z49echi.fsf@web.de>

Dr. Arne Babenhauserheide writes:

> When creating an RSS feed, org-publish broke for me with
>
>   signal(error ("Not an Org time string: "))
>   error("Not an Org time string: %s" "")
>   org-parse-time-string("")
>   org-time-string-to-time("")
[...]
> Maybe relevant: I have date enabled in options.
> #+OPTIONS: date:t

I'm not an ox-rss user and don't know if there are more realistic ways
to hit this error, but I was able to trigger it by taking an already
exported buffer of

--8<---------------cut here---------------start------------->8---
* h1
  :PROPERTIES:
  :ID:       76841adc-b233-4f6d-8446-3478f263544b
  :PUBDATE:  <2021-01-10 Sun 17:46>
  :END:
--8<---------------cut here---------------end--------------->8---

and then setting PUBDATE to an empty string and exporting again.

I'm not sure if the error you see is indicative of a larger issue,
though either way guarding against an empty string as your patch does
seems fine.  But...
 
> diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el
> index 299d22086..97a4bfc8f 100644
> --- a/contrib/lisp/ox-rss.el
> +++ b/contrib/lisp/ox-rss.el
> @@ -245,7 +245,7 @@ communication channel."
>  			(or (org-element-property :CATEGORY headline) "") info))
>  	     (pubdate0 (org-element-property :PUBDATE headline))
>  	     (pubdate (let ((system-time-locale "C"))
> -			(if pubdate0
> +			(if (and pubdate0 (not (string-empty-p pubdate0))

... you're missing a closing parenthesis here.

Also, a bit downstream I see

  (if (not pubdate0) "" ;; Skip entries with no PUBDATE prop

It seems like this should be updated to look at pubdate rather than
pubdate0 to avoid "<pubDate>nil</pubDate>" for the empty string case.

What do you think?


  reply	other threads:[~2021-01-10 23:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07  1:56 Bug: [patch] fix: ox-rss died when an entry had an empty date [ ( @ /home/arne/.guix-profile/share/emacs/site-lisp/)] Dr. Arne Babenhauserheide
2021-01-10 23:08 ` Kyle Meyer [this message]
2021-04-30  7:04   ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0skpezy.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=arne_bab@web.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).