Date | Content | Impact |
---|
KeyError | Python 3.7.3: /usr/bin/python3.7 Wed Sep 18 21:46:41 2024 |
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/home/atdeso/public_html/python/recent_posts.py in <module>() |
127 pMonth = datetime.datetime.fromtimestamp( (ts) ).strftime('%-m') |
128 |
=> 129 mPosts[pYear][pMonth]['total'] += 1 |
130 nPosts['total'] = nPosts['total'] +1 |
131 |
mPosts = {'2021': {'1': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '10': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '11': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '12': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '2': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '3': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '4': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '5': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '6': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '7': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, ...}, '2022': {'1': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '10': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '11': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '12': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '2': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '3': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '4': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '5': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '6': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, '7': {'comments': 0, 'diamonds': 0, 'likes': 0, 'qreposts': 0, 'reposts': 0, 'total': 0}, ...}}, pYear = '2024', pMonth = '2' |
KeyError: '2024'
args =
('2024',)
with_traceback =
<built-in method with_traceback of KeyError object>