ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] taskwarrior: '-942464' is not a valid date in the '' format.
@ 2021-05-11 18:34 Kirill Maslinsky
  0 siblings, 0 replies; only message in thread
From: Kirill Maslinsky @ 2021-05-11 18:34 UTC (permalink / raw)
  To: ALT Devel discussion list


Всем привет,

По мотивам борьбы с rpm-build-python собираю новую версию task (проект
taskwarrior.org). Некоторые тесты (в хэшере) в новой версии стали падать
с интересной ошибкой:

$ task three due:someday
'-942464' is not a valid date in the '' format.

Может, кто-нибудь подскажет, куда копать?

Вот код, который отвечает за формирование даты “someday”:

// later/abbrev  [ !<alpha> && !<digit> ]
// someday/abbrev  [ !<alpha> && !<digit> ]
bool Datetime::initializeLater (Pig& pig)
{
  auto checkpoint = pig.cursor ();

  std::string token;
  if ((pig.skipPartial ("later", token) &&
      token.length () >= static_cast <std::string::size_type> (Datetime::minimumMatchLength))

      ||

     (pig.skipPartial ("someday", token) &&
      token.length () >= static_cast <std::string::size_type> (std::max (Datetime::minimumMatchLength, 4))))
  {
    auto following = pig.peek ();
    if (! unicodeLatinAlpha (following) &&
        ! unicodeLatinDigit (following))
    {
      time_t now = time (nullptr);
      struct tm* t = localtime (&now);

      t->tm_hour = t->tm_min = t->tm_sec = 0;
      t->tm_year = 8099;  // Year 9999
      t->tm_mon = 11;
      t->tm_mday = 30;
      t->tm_isdst = -1;
      _date = mktime (t);
      return true;
    }
  }

В предыдущей версии someday был отнесен в 2038 год, и всё работало, но
тут разработчики решили, видимо, что 2038 — это слишком уж скоро)

Коммит, где сдвинули дату:
https://github.com/GothenburgBitFactory/libshared/commit/f4f2803ab33274a113b1a0265fb32c271fa805ea#diff-87bf33523de4b0db7b37702262674dbf849e9f79686761c334c1cd04412b295e

-- 
KM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-11 18:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11 18:34 [devel] taskwarrior: '-942464' is not a valid date in the '' format Kirill Maslinsky

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git