- edited description
non-ascii characters in python files and no encoding specified
Issue #592
resolved
On a default Dolfin config/install, I'm getting
-- Generating form files in demo, test, bench and dolfin directories. May take some time...
-- ----------------------------------------------------------------------------------------
CMake Error at CMakeLists.txt:883 (message):
Generation of form files failed:
Traceback (most recent call last):
File "/usr/local/bin/ffc", line 213, in <module>
sys.exit(main(sys.argv[1:]))
File "/usr/local/bin/ffc", line 170, in main
ufd = load_ufl_file(filename)
File "/usr/local/lib/python2.7/dist-packages/ufl/algorithms/formfiles.py", line 193, in load_ufl_file
namespace = execute_ufl_code(uflcode, filename)
File "/usr/local/lib/python2.7/dist-packages/ufl/algorithms/formfiles.py", line 97, in execute_ufl_code
m = __import__(basename)
File "/home/nschloe/software/fenics/dolfin/pristine/demo/undocumented/poisson-disc/cpp/PoissonDisc_debug.py", line 4
SyntaxError: Non-ASCII character '\xc3' in file
/home/nschloe/software/fenics/dolfin/pristine/demo/undocumented/poisson-disc/cpp/PoissonDisc_debug.py
on line 4, but no encoding declared; see
http://www.python.org/peps/pep-0263.html for details
I believe the culprit is @martinal's "æ" (\xc3\xa6
) in the copyright notice. I suggest for @martinal to change his name or, alternatively, to add
# -*- coding: utf-8 -*-
to the beginning of each generated file (right below #!/usr/bin/env python
, if it exists).
Comments (10)
-
reporter -
-
assigned issue to
-
assigned issue to
-
in next
-
Sorry, didnt read this properly, only fixed in dolfin site-packages/. I'll add the fix you suggest to ufl.
-
in ufl next
-
reporter The tentative fix is incorrect. The header has to be
#!/usr/bin/env python # -*- coding: utf-8 -*-
i.e., the line
# -*- coding: utf-8 -*-
cannot appear any later. Can be checked by executing#!/usr/bin/env python import re # -*- coding: utf-8 -*- # Copyright (C) 2015-2015 Martin Sandve Alnæs print('123')
-
Another fix in ufl next.
-
- changed status to resolved
I believe this is fixed, re-open if there are more problems.
-
reporter That did the trick, thank you.
-
- removed milestone
Removing milestone: 1.7 (automated comment)
- Log in to comment