[docutils:bugs] Re: #436 docutils doesn't build with Python 3.11

"Günter Milde" via Docutils-develop <[email protected]>
Newsgroups gmane.text.docutils.devel
Message-ID </p/docutils/bugs/436/e5e5fe68841a7361a13bfccf84253eafbfa4494c.bugs@docutils.p.sourceforge.net>
> reading a utf-16 file in latin1 gives funny results.

In the test, this is intentional. In praxi, utf-16 is recognized by the BOM and correctly decoded, if the "input_encoding" setting is left at its default (None).

> maybe breaking processing of the file would be better than producing garbled output

See [feature-requests:#92].


---

** [bugs:#436] docutils doesn't build with Python 3.11**

**Status:** open-fixed
**Created:** Fri Nov 26, 2021 12:39 PM UTC by Tomáš Hrnčiar
**Last Updated:** Sun Nov 28, 2021 10:36 AM UTC
**Owner:** nobody


Hello,

in Fedora we started with rebuilding Python packages with preleases of Python 3.11, currently it is 2nd alpha. 

Docutils doesn't build because 3.11 adds support for null characters in the csv module, which breaks a test. See reproducer below.

>>> import csv
>>> from docutils.parsers.rst.directives import tables
>>> with open('utf-16.csv', 'rb') as f: csv_data = f.read()
... 
>>> csv_data = str(csv_data, 'latin1').splitlines()
>>> reader = csv.reader([tables.CSVTable.encode_for_csv(line + '\n') for line in csv_data])
>>> next(reader)

Python 3.11:

['þÿ\x00"\x00T\x00r\x00e\x00a\x00t\x00"\x00', '\x00 \x00"\x00Q\x00u\x00a\x00n\x00t\x00i\x00t\x00y\x00"\x00', '\x00 \x00"\x00D\x00e\x00s\x00c\x00r\x00i\x00p\x00t\x00i\x00o\x00n\x00"\x00']

Python 3.10:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
_csv.Error: line contains NUL



---

Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/docutils/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.