Suse 11.1 - can't run (8-bit bytestring)

  • gilap

    gilap - 2009-01-05

    I installed gourmet according to the instructions in the readme. When I want to run it, I get the following error message.

    "You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings."

    I'm still quite a noob and I have no idea what this means.

    Thanks for any help

    • tom

      tom - 2009-01-05

      Most likely it means that you have a newer version of the database library I use (sqlalchemy) which does not support the way Gourmet is programmed. This is something I'll need to fix eventually, so it's good for me to know about it.

      Can you tell me what version of Gourmet you have?

      Might you be able to tell me what version of python-sqlalchemy you have? You can answer the second question by typing the following commands at a commandline:

      $ python
      >>> import sqlalchemy
      >>> sqlalchemy.__version__

      You can then type "Control-D" to exit python and get back to a normal shell. The number (in my case: 0.4.6) is what I'm curious about.

      • gilap

        gilap - 2009-01-06

        Unfortunately I have uninstalled Suse 11.1 and reverted back to Suse 11. I had just too many issues with too many programs.
        I did use gourmet version 13.8, which runs perfect under Suse 11.

        I must admit, I don't think I had sqalchemy installed, but I'm not sure.

        Thanks for your reply and this excellent program. I couldn't do without it.

    • lgaud

      lgaud - 2009-01-24

      I've run into what I think is the same issue on Windows.

      Gourmet version 0.13.8
      sqlalchemy version is 0.4.8
      Python 2.6

      I'll try getting an older version of sqlalchemy and report back :)

      Full dump:
      E:\Programs\gourmet-0.13.8>C:\python26\python.exe C:\python26\gourmet\gourmet
      Couldn't find data... I hope it's in ../../../../gourmet/data/
      DATAD =  C:\python26\gourmet\data
      C:\python26\lib\site-packages\gourmet\ DeprecationWarning: the md
      5 module is deprecated; use hashlib instead
        import Image, urllib, md5, os.path, os, StringIO
      Using sqlite3
      Loading  gnomeprint  failed: trying  win
      No gnome player
      Player is  gourmet.sound_windows.Player
      Fixing broken ingredient-key view from earlier versions.
      UPDATE FROM < 0.13.0...
      Alter table
      ALTER TABLE recipe ADD last_modified INTEGER
      Alter table
      ALTER TABLE recipe ADD recipe_hash VARCHAR(32)
      Alter table
      ALTER TABLE recipe ADD ingredient_hash VARCHAR(32)
      Alter table
      ALTER TABLE recipe ADD link text
      Searching for links in old recipe fields...
      Failed to execute:
      sql   :  SELECT rowid, word, item, ingkey, count, rowid FROM keylookup where ite
      m ==  ? AND ingkey ==  ?
      params:  ['jalape\xc3\xb1o pepper', 'pepper, jalape\xc3\xb1o']
      Traceback (most recent call last):
        File "C:\python26\gourmet\gourmet", line 35, in <module>
        File "C:\python26\lib\site-packages\gourmet\", line 152
      8, in startGUI
        File "C:\python26\lib\site-packages\gourmet\", line 169
      , in __init__
        File "C:\python26\lib\site-packages\gourmet\", line 462
      , in init_recipes
          self.rd = recipeManager.RecipeManager(**recipeManager.dbargs)
        File "C:\python26\lib\site-packages\gourmet\backends\", line 97, i
      n __init__
 = keymanager.KeyManager(rm=self)
        File "C:\python26\lib\site-packages\gourmet\", line 31, in __init
        File "C:\python26\lib\site-packages\gourmet\", line 37, in initia
        File "C:\python26\lib\site-packages\gourmet\backends\", line 960,
      in add_ing_to_keydic
          row = self.fetch_one(self.ikview, item=item, ingkey=key)
        File "C:\python26\lib\site-packages\gourmet\backends\", line 170, in
          self.execute(self.cursor,'SELECT '+', '.join(column_names)+' FROM %s '%table
      + where,params)
        File "C:\python26\lib\site-packages\gourmet\backends\", line 114, in
      sqlite3.ProgrammingError: You must not use 8-bit bytestrings unless you use a te
      xt_factory that can interpret 8-bit bytestrings (like text_factory = str). It is
      highly recommended that you instead just switch your application to Unicode str

    • lgaud

      lgaud - 2009-01-24

      The same thing is happening after I went to sqlalchemy 0.4.6 which I tried since Tom mentioned it. I removed Gourmet from the site-packages folder of python and re-installed it just in case (this is the first I've dealt with python packages, that *looked* like enough to do a clean install but I'm not 100% sure)

      I'm running Vista Business 64bit.

    • lgaud

      lgaud - 2009-01-24

      I switched gears to trying Gourmet 0.14.3 today, and I'm getting a different database error. I've got sqlalchemy 0.4.6 as I downgraded last night.

      Traceback (most recent call last):
        File "c:\python26\Lib\site-packages\gourmet\", line 203, in setup_recipes
          self.rd = recipeManager.default_rec_manager()
        File "c:\python26\Lib\site-packages\gourmet\", line 134, in default_rec_manager
          return get_recipe_manager(**dbargs)
        File "c:\python26\Lib\site-packages\gourmet\", line 129, in get_recipe_manager
          return RecipeManager(**args)
        File "c:\python26\Lib\site-packages\gourmet\backends\", line 1589, in __init__
        File "c:\python26\Lib\site-packages\gourmet\backends\", line 151, in __init__
        File "c:\python26\Lib\site-packages\gourmet\backends\", line 447, in update_version_info
          for ingredient in self.fetch_all(self.ingredients_table,deleted=False):
        File "c:\python26\Lib\site-packages\gourmet\backends\", line 602, in fetch_all
        File "C:\python26\lib\site-packages\sqlalchemy\sql\", line 1087, in execute
          return e.execute_clauseelement(self, multiparams, params)
        File "C:\python26\lib\site-packages\sqlalchemy\engine\", line 1219, in execute_clauseelement
          return connection.execute_clauseelement(elem, multiparams, params)
        File "C:\python26\lib\site-packages\sqlalchemy\engine\", line 895, in execute_clauseelement
          return self._execute_compiled(elem.compile(dialect=self.dialect, column_keys=keys, inline=len(params) > 1), distilled_params=params)
        File "C:\python26\lib\site-packages\sqlalchemy\engine\", line 907, in _execute_compiled
        File "C:\python26\lib\site-packages\sqlalchemy\engine\", line 916, in __execute_raw
          self._cursor_execute(context.cursor, context.statement, context.parameters[0], context=context)
        File "C:\python26\lib\site-packages\sqlalchemy\engine\", line 960, in _cursor_execute
          self._handle_dbapi_exception(e, statement, parameters, cursor)
        File "C:\python26\lib\site-packages\sqlalchemy\engine\", line 942, in _handle_dbapi_exception
          raise exceptions.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect)
      OperationalError: (OperationalError) no such column: ingredients.recipe_id u'SELECT, ingredients.recipe_id, ingredients.refid, ingredients.unit, ingredients.amount, ingredients.rangeamount, ingredients.item, ingredients.ingkey, ingredients.optional, ingredients.shopoptional, ingredients.inggroup, ingredients.position, ingredients.deleted \nFROM ingredients \nWHERE ingredients.deleted = ?' [0]

    • lgaud

      lgaud - 2009-02-09

      I just went through and did a complete re-install of everything on Windows starting from Python 2.5 instead of 2.6. Also Gourmet 14.5 which wasn't up last time I tried playing with it on windows.

      I did something like this: Installed it under a fresh Python 2.5 install. Got the 8-bit error. Remembered that I hadn't wiped out the C:\Users\username\AppData\Roaming folder where gourmet stores the DB, wiped that out, ran the install again (not clean). Got the error again. Ran the install script again just because, and then, it worked.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks