tripleee / sloshy

Sloshy the Thawman, a simple chatbot to keep rooms alive on Stack Overflow / Stack Exchange
6 stars 11 forks source link

Nightly #1028 failed on date extraction #108

Closed tripleee closed 1 month ago

tripleee commented 1 month ago

https://github.com/tripleee/sloshy/actions/runs/9901289793 failed with a traceback:

.1" 200 None
2024-07-12 02:09:13,290 DEBUG https://chat.stackexchange.com:443 "GET /transcript/113019 HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://chat.stackexchange.com:443 "GET /transcript/113019 HTTP/1.1" 200 None
Traceback (most recent call last):
  File "/home/runner/work/sloshy/sloshy/./run.py", line 29, in <module>
    sloshy.perform_scan("nightly run")
  File "/home/runner/work/sloshy/sloshy/sloshy.py", line 659, in perform_scan
    self.scan_rooms(startup_message, slow_summary)
  File "/home/runner/work/sloshy/sloshy/sloshy.py", line 586, in scan_rooms
    room_latest = fetcher.latest(room.id, room.server)
  File "/home/runner/work/sloshy/sloshy/scrape_chat.py", line 287, in latest
    return self.usercount(room, server, **kwargs)[0]
  File "/home/runner/work/sloshy/sloshy/scrape_chat.py", line 223, in usercount
    for message in self.messages(server, room):
  File "/home/runner/work/sloshy/sloshy/scrape_chat.py", line 119, in messages
    date = datetime.strptime(datestr, '%Y-%m-%d')
  File "/usr/lib/python3.10/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/lib/python3.10/_strptime.py", line [35](https://github.com/tripleee/sloshy/actions/runs/9901289793/job/27353416626#step:3:36)2, in _strptime
    raise ValueError("unconverted data remains: %s" %
ValueError: unconverted data remains:

Dunno if this is reproducible; the transcript page shows me a plain timestamp right now:

<div class="timestamp">2:09 AM</div>
tripleee commented 1 month ago

Vaguely guessing the element had newlines or other whitespace added to it, and that the <code>.strip()</code> I threw in there fixed it?</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>