I am writing a test for a database that has Swedish characters. In the test, I directly use characters with umlauts and other similar Swedish ligatures, and it works great by reading the file names from the database and successfully executing the string.
However, when importing this file to generate pydoc, I get a too familiar exception:
SyntaxError: non-ASCII character '\ xc3' in file foo.py on line 1, but no encoding declared; See http://www.python.org/peps/pep-0263.html for more details.
Having done some research on my own, I found that adding
At the top of my file, the import problem was fixed. However, the test does not currently perform all string comparisons. I tried an alternative method of refusing to declare encoding and writing strings as
u"BokmΓ€rken"
... but this still does not allow verification.
Does anyone know a good way to fix this?
source share