After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 333737 - __init__.py uses argv even when there is no argv.
__init__.py uses argv even when there is no argv.
Status: RESOLVED FIXED
Product: pygtk
Classification: Bindings
Component: gtk
Git Master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2006-03-07 12:32 UTC by Murray Cumming
Modified: 2006-05-06 21:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Murray Cumming 2006-03-07 12:32:42 UTC
I think this code is new in pygtk 2.9/2.10, in __init__.py:

_is_pydoc = False
if sys.argv:
    name = os.path.basename(sys.argv[0])
    if 'pydoc' in name:
        _is_pydoc = True

This crashes:

Traceback (most recent call last):
  • File "<string>", line 8 in glom_calc_field_value
  • File "/opt/gnome214/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line 36 in ?
    if sys.argv:

when I use pygtk in a script when I embed python, because I am not providing any command-line arguments to the embedded python environments (I'm not even sure how to). It works fine with pygtk 2.8. Could pygtk 2.9 detect the lack of sys.argv and work past this, please?
Comment 1 Johan (not receiving bugmail) Dahlin 2006-03-07 12:40:07 UTC
You should call PySys_SetArgv under normal circumstances. But I guess that it's still worth fixing for 2.10.
Comment 2 Daniel Holbach 2006-04-12 08:16:29 UTC
Could this be related to: https://launchpad.net/distros/ubuntu/+source/pygtk/+bug/39035 ?
Comment 3 Johan (not receiving bugmail) Dahlin 2006-05-06 21:04:16 UTC
Fixed in CVS head.