LBeaudoux / tatoebatools

A library for fetching and reading Tatoeba's weekly exports
MIT License
20 stars 4 forks source link

Python 3.11 quotechar must be 1-character string error #12

Closed Rozinig closed 1 year ago

Rozinig commented 1 year ago

Changed quotechar from "" to "'" in config.py and datafile.py This should fix the "quotechar" must be a 1-character string error as based on issue discussing it in Python 3.11+ as it changes the quotechar to a 1-character string, as requested. This shouldn't cause other issues as based on the answer to https://stackoverflow.com/questions/16833209/typeerror-quotechar-must-be-an-1-character-string "quoting controls what will be quoted when (defaulting to QUOTE_MINIMAL, i.e., only when quotes are absolutely necessary). If you turn off quoting entirely (QUOTE_NONE), the value of quotechar is of course meaningless.", the quoting is set to QUOTE_NONE so the quotechar is ignored when its used in the datafile.py, except for the whatever check is raising this error. This fixes the issue on my machine with python 3.11.1. I did not test it under any other circumstances. I'm new at this so, if I missed something please let me know.

LBeaudoux commented 1 year ago

@Rozinig thanks for your PR. Your bug fix has been improved by @Fried-Squid in the PR #13 that I just merged. Thanks to both of you, the next release of tatoebatools should support python 3.8 to python 3.11.