sfstoolbox / sfs-python

SFS Toolbox for Python

Home Page:https://sfs-python.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Encoding not declared?

hagenw opened this issue · comments

In the latest version of the toolbox we introduced an Umlaut, I guess this leads to this startup error:

>>> import sfs
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sfs/__init__.py", line 17, in <module>
    from . import mono
  File "sfs/mono/__init__.py", line 2, in <module>
    from . import source
  File "sfs/mono/source.py", line 410
SyntaxError: Non-ASCII character '\xc3' in file sfs/mono/source.py on line 411, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

This should only be an error on Python 2.

I see 3 options:

  1. Specify encoding, as suggested by the error message. This will solve the problem for Python 2 and make it unnecessary ugly for Python 3
  2. Don't support Python 2 at all. This is a little harsh, especially since PyPy support for Python 3 is limited
  3. Replace the one umlaut by something harmless, like M"oser.

I would prefer the third option. Is it ok, to push this directly to the master?