File: remove-U-mode-when-opening-files.patch

package info (click to toggle)
q-text-as-data 3.1.6-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,820 kB
  • sloc: python: 5,872; sh: 157; javascript: 52; makefile: 23
file content (20 lines) | stat: -rw-r--r-- 1,014 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Description: Python 3.11: Remove U mode when opening files
Author: Thomas Goirand <zigo@debian.org>
Bug-Debian: https://bugs.debian.org/1028139
Forwarded: no
Last-Update: 2023-01-09

--- q-text-as-data-3.1.6.orig/bin/q.py
+++ q-text-as-data-3.1.6/bin/q.py
@@ -1403,10 +1403,7 @@ class DelimitedFileReader(object):
                 f = gzip.open(filename,mode='rt',encoding=self.input_params.input_encoding)
             else:
                 if six.PY3:
-                    if self.input_params.with_universal_newlines:
-                        f = io.open(filename, 'rU', newline=None, encoding=self.input_params.input_encoding)
-                    else:
-                        f = io.open(filename, 'r', newline=None, encoding=self.input_params.input_encoding)
+                    f = io.open(filename, 'r', newline=None, encoding=self.input_params.input_encoding)
                 else:
                     if self.input_params.with_universal_newlines:
                         file_opening_mode = 'rbU'