File: 0002-Open-tests.ldif-as-UTF-8-for-Python-2-compatibility.patch

package info (click to toggle)
django-auth-ldap 1.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 480 kB
  • sloc: python: 2,282; makefile: 26
file content (21 lines) | stat: -rw-r--r-- 669 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
From: Michael Fladischer <FladischerMichael@fladi.at>
Date: Sat, 22 Dec 2018 20:22:10 +0100
Subject: Open tests.ldif as UTF-8 for Python 2 compatibility.

---
 tests/tests.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/tests.py b/tests/tests.py
index fe1066d..a8fcaf8 100644
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -134,7 +134,7 @@ class LDAPTest(TestCase):
             'nis.schema',
         ]
         cls.server.start()
-        with io.open(os.path.join(here, 'tests.ldif')) as fp:
+        with io.open(os.path.join(here, 'tests.ldif'), encoding='utf-8') as fp:
             ldif = fp.read()
         cls.server.ldapadd(ldif)