File: fix-test-for-python3.11.patch

package info (click to toggle)
python-unicodecsv 0.14.1-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 192 kB
  • sloc: python: 1,036; makefile: 3
file content (24 lines) | stat: -rw-r--r-- 971 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: fix test for Python 3.11
 Thanks to s3v <c0llapsed@yahoo.it> for the right hint!
Author: Martin <debacle@debian.org>
Origin: vendor
Bug-Debian: https://bugs.debian.org/1026602
Last-Update: 2023-01-21
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/unicodecsv/test.py
+++ b/unicodecsv/test.py
@@ -247,9 +247,10 @@
         self._read_test([b''], [[]])
         self.assertRaises(csv.Error, self._read_test,
                           [b'"ab"c'], None, strict=1)
-        # cannot handle null bytes for the moment
-        self.assertRaises(csv.Error, self._read_test,
-                          [b'ab\0c'], None, strict=1)
+        # cannot handle null bytes with Python < 3.11
+        if sys.version_info < (3, 11):
+            self.assertRaises(csv.Error, self._read_test,
+                              [b'ab\0c'], None, strict=1)
         self._read_test([b'"ab"c'], [['abc']], doublequote=0)
 
     def test_read_eol(self):