nebius/SWE-bench-extra huggingface dataset:
Repository: mixkorshun/django-antispam

Issue:
Akismet: AssertionError on comment_date type
python-akismet expects comment_date to be `datetime`, not a timestamp:

https://github.com/Nekmo/python-akismet/blob/322cf3e9a9a1986434a20e01cabb6767e91a226b/akismet/__init__.py#L49

django-antispam provides a timestamp:

https://github.com/mixkorshun/django-antispam/blob/3b193a8360ff8171f0c6d7cc1891fab0b69d0e0a/antispam/akismet/entities.py#L155

So I get an `AssertionError` when calling `akismet.check`

Comments:

Patch:
diff --git a/antispam/akismet/entities.py b/antispam/akismet/entities.py
index 91d766a..a620516 100644
--- a/antispam/akismet/entities.py
+++ b/antispam/akismet/entities.py
@@ -1,6 +1,6 @@
 from datetime import datetime
 
-from .utils import get_client_ip, get_timestamp
+from .utils import get_client_ip
 
 
 class Request:
@@ -152,7 +152,7 @@ class Comment:
         params = {
             'comment_type': self.type,
             'comment_content': self.content,
-            'comment_date': get_timestamp(self.created),
+            'comment_date': self.created,
             'permalink': self.permalink,
         }
 
diff --git a/antispam/akismet/utils.py b/antispam/akismet/utils.py
index b6cdf72..c292c1a 100644
--- a/antispam/akismet/utils.py
+++ b/antispam/akismet/utils.py
@@ -18,11 +18,3 @@ def get_client_ip(request):
         return x_forwarded_for.split(',')[0]
 
     return request.META.get('REMOTE_ADDR')
-
-
-def get_timestamp(dt):
-    try:
-        return int(dt.timestamp())
-    except AttributeError:
-        import time
-        return int(time.mktime(dt.timetuple()))


Test patch:
diff --git a/tests/akismet/test_entities.py b/tests/akismet/test_entities.py
index 2f92116..c1e536d 100644
--- a/tests/akismet/test_entities.py
+++ b/tests/akismet/test_entities.py
@@ -70,7 +70,7 @@ class CommentTests(TestCase):
 
         self.assertEqual({
             'comment_content': '<my comment>',
-            'comment_date': int(time.mktime(comment.created.timetuple())),
+            'comment_date': comment.created,
             'comment_type': 'comment',
             'permalink': 'http://mike.example.com/comment-1/',
         }, comment.as_params())
Repository: miyuchina/mistletoe

Issue:
lists should not contain <p>
Why do you use &lt;p&gt;&lt;/p&gt; in lists ? This is not the way Commonmark does it.

Other strange behavior: in the same document, some lists get the paragraphs, some others don't. Could you explain how it is supposed to work ?

Comments:

Patch:
diff --git a/mistletoe/block_token.py b/mistletoe/block_token.py
index 0a4c2c0..7eeb3f1 100644
--- a/mistletoe/block_token.py
+++ b/mistletoe/block_token.py
@@ -574,6 +574,9 @@ class ListItem(BlockToken):
             if not cls.in_continuation(next_line, prepend):
                 # directly followed by another token
                 if cls.other_token(next_line):
+                    if newline:
+                        lines.backstep()
+                        del line_buffer[-newline:]
                     break
                 # next_line is a new list item
                 marker_info = cls.parse_marker(next_line)


Test patch:
diff --git a/test/test_block_token.py b/test/test_block_token.py
index b3c94b1..78fb0b2 100644
--- a/test/test_block_token.py
+++ b/test/test_block_token.py
@@ -191,6 +191,14 @@ class TestListItem(unittest.TestCase):
         list_item = block_token.tokenize(lines)[0].children[0]
         self.assertEqual(list_item.loose, False)
 
+    def test_tight_list(self):
+        lines = ['- foo\n',
+                 '\n',
+                 '# bar\n']
+        f = FileWrapper(lines)
+        list_item = block_token.tokenize(lines)[0].children[0]
+        self.assertEqual(list_item.loose, False)
+
 
 class TestList(unittest.TestCase):
     def test_different_markers(self):