Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 288887 - app-misc/gourmet-0.13.8 doesn't work with python-2.6(?)
Summary: app-misc/gourmet-0.13.8 doesn't work with python-2.6(?)
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Joe Sapp (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-13 15:18 UTC by Rodrigo Saboya
Modified: 2010-05-08 03:36 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
gourmet-python-2.6-compiled_re_flags.patch (gourmet-python-2.6-compiled_re_flags.patch,556 bytes, patch)
2009-10-13 15:19 UTC, Rodrigo Saboya
Details | Diff
New ebuild to apply the patch (gourmet-0.13.8.ebuild,1.09 KB, text/plain)
2009-10-13 16:55 UTC, Rodrigo Saboya
Details
New version (gourmet-0.15.0.ebuild,1014 bytes, text/plain)
2009-10-13 16:59 UTC, Rodrigo Saboya
Details
Patch to fix the use utf-8 bytestrings with sqlite3 (patch for app-misc/gourmet-0.13.8) (gourmet-0.13.8-python-2.6-sqlite_text_factory.patch,600 bytes, patch)
2009-10-13 21:48 UTC, Rodrigo Saboya
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rodrigo Saboya 2009-10-13 15:18:07 UTC
app-misc/gourmet crashes on startup with a compiled re error when trying to pass flags to an already compiled pattern. I think this was introduced in python-2.6.

Reproducible: Always

Steps to Reproduce:
1. emerge gourmet
2. run it
3.

Actual Results:  
/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
/usr/lib/python2.6/site-packages/gourmet/thumbnail.py:1: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import Image, urllib, md5, os.path, os, StringIO
Traceback (most recent call last):
  File "/usr/bin/gourmet", line 13, in <module>
    from gourmet.OptionParser import *
  File "/usr/lib/python2.6/site-packages/gourmet/__init__.py", line 12, in <module>
    import convert
  File "/usr/lib/python2.6/site-packages/gourmet/convert.py", line 734, in <module>
    FRACTION_MATCHER = re.compile(NUM_AND_FRACTION_REGEXP,re.UNICODE)
  File "/usr/lib/python2.6/re.py", line 190, in compile
    return _compile(pattern, flags)
  File "/usr/lib/python2.6/re.py", line 238, in _compile
    raise ValueError('Cannot process flags argument with a compiled pattern')
ValueError: Cannot process flags argument with a compiled pattern

Expected Results:  
No errors.

Patch follows.
Comment 1 Rodrigo Saboya 2009-10-13 15:19:57 UTC
Created attachment 206978 [details, diff]
gourmet-python-2.6-compiled_re_flags.patch

This fixes the problem, but I get a different error when I start the app:

/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
/usr/lib/python2.6/site-packages/gourmet/thumbnail.py:1: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import Image, urllib, md5, os.path, os, StringIO
Using sqlite3
Loading  gnomeprint  failed: trying  win
Loading  win  failed: trying  lpr
/usr/lib/python2.6/site-packages/gourmet/LinkedTextView.py:78: GtkWarning: gdk_cursor_new_for_display: assertion `GDK_IS_DISPLAY (display)' failed
  hand_cursor = gtk.gdk.Cursor(gtk.gdk.HAND2)
Traceback (most recent call last):
  File "/usr/bin/gourmet", line 34, in <module>
    import gourmet.GourmetRecipeManager
  File "/usr/lib/python2.6/site-packages/gourmet/GourmetRecipeManager.py", line 9, in <module>
    import prefs, prefsGui, shopgui, reccard, convertGui, fnmatch, tempfile
  File "/usr/lib/python2.6/site-packages/gourmet/shopgui.py", line 3, in <module>
    import recipeManager, convert, WidgetSaver, reccard
  File "/usr/lib/python2.6/site-packages/gourmet/reccard.py", line 28, in <module>
    import LinkedTextView, timeScanner
  File "/usr/lib/python2.6/site-packages/gourmet/LinkedTextView.py", line 75, in <module>
    class LinkedTextView (gtk.TextView):
  File "/usr/lib/python2.6/site-packages/gourmet/LinkedTextView.py", line 78, in LinkedTextView
    hand_cursor = gtk.gdk.Cursor(gtk.gdk.HAND2)
RuntimeError: could not create GdkCursor object

Don't know how to proceed from here.
Comment 2 Rodrigo Saboya 2009-10-13 16:55:19 UTC
Created attachment 206984 [details]
New ebuild to apply the patch
Comment 3 Rodrigo Saboya 2009-10-13 16:59:00 UTC
Created attachment 206985 [details]
New version

This is a version bump for app-misc/gourmet. This new ebuild does not require patches to run on python-2.6, but it suffers from the sabe bug described in comment 1.

Has a dep on >=dev-python/sqlalchemy-0.5.5
Comment 4 Rodrigo Saboya 2009-10-13 17:09:07 UTC
Well, turns out the latter bug only occurs when I run the app on tilda, clicking the icon works fine for version 0.13.8.

0.15.0 gives me a database error, I'm working on it.
Comment 5 Rodrigo Saboya 2009-10-13 21:48:35 UTC
Created attachment 207023 [details, diff]
Patch to fix the use utf-8 bytestrings with sqlite3 (patch for app-misc/gourmet-0.13.8)

Withouth this patch, I get the following error during some operations wit the application:

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/gourmet/GourmetRecipeManager.py", line 743, in show
    w=reccard.RecCard(self, rec)
  File "/usr/lib/python2.6/site-packages/gourmet/reccard.py", line 106, in __init__
    self.updateRecipe(recipe,show=False)
  File "/usr/lib/python2.6/site-packages/gourmet/reccard.py", line 682, in updateRecipe
    self.updateRec(rec)
  File "/usr/lib/python2.6/site-packages/gourmet/reccard.py", line 707, in updateRec
    self.resetIngredients()
  File "/usr/lib/python2.6/site-packages/gourmet/reccard.py", line 928, in resetIngredients
    self.update_nutrition_info()
  File "/usr/lib/python2.6/site-packages/gourmet/reccard.py", line 845, in update_nutrition_info
    self.rg.nd.get_nutinfo_for_inglist(ings,self.rd)
  File "/usr/lib/python2.6/site-packages/gourmet/nutrition/nutrition.py", line 116, in get_nutinfo_for_inglist
    return NutritionInfoList([self.get_nutinfo_for_ing(i,rd) for i in inglist])
  File "/usr/lib/python2.6/site-packages/gourmet/nutrition/nutrition.py", line 110, in get_nutinfo_for_ing
    return self.get_nutinfo_for_item(ing.ingkey,amount,ing.unit)
  File "/usr/lib/python2.6/site-packages/gourmet/nutrition/nutrition.py", line 121, in get_nutinfo_for_item
    ni=self.get_nutinfo(key)
  File "/usr/lib/python2.6/site-packages/gourmet/nutrition/nutrition.py", line 138, in get_nutinfo
    aliasrow = self._get_key(key)
  File "/usr/lib/python2.6/site-packages/gourmet/nutrition/nutrition.py", line 95, in _get_key
    row=self.db.fetch_one(self.db.naliasesview,**{'ingkey':str(key)})
  File "/usr/lib/python2.6/site-packages/gourmet/backends/sql_db.py", line 170, in fetch_one
    self.execute(self.cursor,'SELECT '+', '.join(column_names)+' FROM %s '%table + where,params)
  File "/usr/lib/python2.6/site-packages/gourmet/backends/sql_db.py", line 114, in execute
    cursor.execute(sql,params)
sqlite3.ProgrammingError: 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.
Comment 6 Rodrigo Saboya 2009-10-14 15:05:03 UTC
I managed to get 0.15.0 working, I'll just open another ticket requesting a version bump. It's pointless to keep patching the 0.13.8 version.
Comment 7 Joe Sapp (RETIRED) gentoo-dev 2009-11-24 13:36:14 UTC
I believe I've fixed RDEPEND to address this bug.  I don't think I'll try to get this version stabilized since there's now a newer version that works with python-2.6.
Comment 8 Joe Sapp (RETIRED) gentoo-dev 2009-11-24 13:37:00 UTC
(In reply to comment #5)
> Created an attachment (id=207023) [details]
> Patch to fix the use utf-8 bytestrings with sqlite3 (patch for
> app-misc/gourmet-0.13.8)

Did you submit this upstream?
Comment 9 Rodrigo Saboya 2009-11-24 17:58:33 UTC
(In reply to comment #8)
> (In reply to comment #5)
> > Created an attachment (id=207023) [details] [details]
> > Patch to fix the use utf-8 bytestrings with sqlite3 (patch for
> > app-misc/gourmet-0.13.8)
> 
> Did you submit this upstream?
> 

I tried to, but I got no response from upstream. I tried contacting the lead author through Sourceforge (where the project is hosted), with no success.
Comment 10 Andrew Herr 2010-03-09 05:52:22 UTC
Perhaps this should be a separate bug, but since it was mentioned here previously, I figured.  I am having a database error with 0.15.0 with python 2.6.4 (before and after 2.6.4-r1).  This problem started when I upgraded to 0.15.0 from 0.13.8.  Output follows.

/usr/lib64/python2.6/site-packages/gourmet/GourmetRecipeManager.py:715: GtkWarning: toggleRegexp: missing action toggleRegexp
  gtk.main_iteration()
/usr/lib64/python2.6/site-packages/gourmet/GourmetRecipeManager.py:715: GtkWarning: toggleSearchAsYouType: missing action toggleSearchAsYouType
  gtk.main_iteration()
Traceback (most recent call last):
  File "/usr/bin/gourmet", line 35, in <module>
    gourmet.GourmetRecipeManager.startGUI()
  File "/usr/lib64/python2.6/site-packages/gourmet/GourmetRecipeManager.py", line 709, in startGUI
    r=RecGui(splash_label=splash.label)
  File "/usr/lib64/python2.6/site-packages/gourmet/GourmetRecipeManager.py", line 925, in __init__
    editable=False)
  File "/usr/lib64/python2.6/site-packages/gourmet/recindex.py", line 66, in __init__
    self.setup_widgets()
  File "/usr/lib64/python2.6/site-packages/gourmet/recindex.py", line 104, in setup_widgets
    self.setup_search_views()
  File "/usr/lib64/python2.6/site-packages/gourmet/recindex.py", line 172, in setup_search_views
    self.rvw = self.rd.search_recipes(self.searches,sort_by=self.sort_by)
  File "/usr/lib64/python2.6/site-packages/gourmet/backends/db.py", line 779, in search_recipes
    order_by=make_order_by(sort_by,self.recipe_table,),
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/sql/expression.py", line 1121, in execute
    return e._execute_clauseelement(self, multiparams, params)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1209, in _execute_clauseelement
    return connection._execute_clauseelement(elem, multiparams, params)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 874, in _execute_clauseelement
    return self.__execute_context(context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 896, in __execute_context
    self._cursor_execute(context.cursor, context.statement, context.parameters[0], context=context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 950, in _cursor_execute
    self._handle_dbapi_exception(e, statement, parameters, cursor, context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 931, in _handle_dbapi_exception
    raise exc.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect)
sqlalchemy.exc.OperationalError: (OperationalError) no such column: recipe.yields u'SELECT DISTINCT recipe.id, recipe.title, recipe.instructions, recipe.modifications, recipe.cuisine, recipe.rating, recipe.description, recipe.source, recipe.preptime, recipe.cooktime, recipe.servings, recipe.yields, recipe.yield_unit, recipe.image, recipe.thumb, recipe.deleted, recipe.recipe_hash, recipe.ingredient_hash, recipe.link, recipe.last_modified \nFROM recipe \nWHERE recipe.deleted = ?' [0]
Comment 11 Joe Sapp (RETIRED) gentoo-dev 2010-05-08 03:36:01 UTC
Masked for removal in 30 days