Commit graph

6 commits

Author SHA1 Message Date
Kip Yin 11f972f817 Catch StopIteration explicitly in group_by_object generator (#264)
Python 3.7 changed the behaviour of generators so that a StopIteration exception which bubbles up inside a generator is transformed into a RuntimeException. This means that when calling next() inside a generator, we have to explicitly catch the StopIteration and exit the function instead of relying on it to implicitly stop the generator. Otherwise the program will crash. Sigh.

For more information, see PEP 479.

https://www.python.org/dev/peps/pep-0479/
https://stackoverflow.com/questions/51700960/runtimeerror-generator-raised-stopiteration-every-time-i-try-to-run-app/51701040#51701040
2019-07-15 13:23:37 -07:00
skylar d17a772b4f Resolve some Python 3 encoding issues on Windows (#244)
When you open a file in Python 3, it defaults to using the system charset to encode the file, which is typically UTF-8 on linux systems (good) but Windows-1251 on Windows (bad).

We need to add explicit encoding=utf-8 arguments to open() calls when we open CSV files for reading or writing. To complicate matters, the csv module works only with byte strings in Python 2, and only with unicode strings in Python 3, so we can't just blindly use `io.open` everywhere.
2018-08-22 23:01:58 -07:00
John T. Wodder II c3f566b2c9 Addressed all of pyflakes3's complaints 2016-11-24 21:29:58 +00:00
Eevee (Alex Munroe) 0ff24b4dc8 Fix the CLI in py3 2015-10-05 16:29:21 -07:00
Eevee (Alex Munroe) b76b74e7a6 Compat with Python 3.3+ 2015-10-05 08:12:23 -07:00
Petr Viktorin 4c2ad2bdf1 Reading, merging, and writing translations 2011-04-11 17:03:27 +03:00