SyntaxError: Non-ASCII character

Help
mithras86
2007-03-24
2013-05-14
  • mithras86
    mithras86
    2007-03-24

    I downloaded the .deb for my Ubuntu Feisty installation, but couldn't get gourmet to work. I get the following terminal output:

    jurian@karlijn:~$ gourmet
    Traceback (most recent call last):
      File "/usr/bin/gourmet", line 34, in <module>
        import gourmet.GourmetRecipeManager
      File "/usr/share/gourmet/GourmetRecipeManager.py", line 9, in <module>
        import prefs, prefsGui, shopgui, reccard, convertGui, fnmatch, tempfile
      File "/usr/share/gourmet/shopgui.py", line 3, in <module>
        import recipeManager, convert, WidgetSaver, reccard
      File "/usr/share/gourmet/reccard.py", line 24, in <module>
        from importers.importer import parse_range
      File "/usr/share/gourmet/importers/__init__.py", line 3, in <module>
        import gxml2_importer, rezkonv_importer
      File "/usr/share/gourmet/importers/rezkonv_importer.py", line 41
    SyntaxError: Non-ASCII character '\xc3' in file /usr/share/gourmet/importers/rezkonv_importer.py on line 41, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
    jurian@karlijn:~$

    Can somebody help me?
    TIA!

     
    • tom
      tom
      2007-03-25

      A change in python requires you to add the following to the top of the file

      /usr/share/gourmet/importers/rezkonv_importer.py

      # -*- coding: utf-8 -*-

      I'm fixing this in CVS as we speak.

       
    • larryni
      larryni
      2007-06-08

      I get a similar error with Feisty and the Gourmet 0.13.4 deb:

      Traceback (most recent call last):
        File "/usr/bin/gourmet", line 13, in <module>
          from gourmet.OptionParser import *
        File "/usr/share/gourmet/__init__.py", line 11, in <module>
          import defaults
        File "/usr/share/gourmet/defaults.py", line 8, in <module>
          lang = __import__('defaults_%s'%loc,globals(),locals())
        File "/usr/share/gourmet/defaults_en_GB.py", line 121
      SyntaxError: Non-ASCII character '\xc3' in file /usr/share/gourmet/defaults_en_GB.py on line 121, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

      I checked rezkonv_importer.py and the line you mentioned above is already there. Any ideas?

       
    • larryni
      larryni
      2007-06-10

      Solved. Just added it to defaults_en_GB.py