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 312337 - gobject.type_register() "already registered" warning should be a deprecation warning
gobject.type_register() "already registered" warning should be a deprecation ...
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gobject
2.9.0
Other Linux
: High normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2005-08-02 11:24 UTC by Mark McLoughlin
Modified: 2006-01-09 14:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
pygtk-type-register-deprecation-warning.patch (988 bytes, patch)
2005-08-02 11:25 UTC, Mark McLoughlin
accepted-commit_now Details | Review

Description Mark McLoughlin 2005-08-02 11:24:38 UTC
Until auto-registration was introduced, all GObject sub-classes had to be
registered using gobject.type_register()

Now, that type_register() is deprecated, however, code written for the previous
API now causes a warning to be printed:

  Warning: Class Foo is already GObject-registered

Since this warning is caused by an API deprecation, existing code that filters
deprecation warnings using:

  warnings.filterwarnings("ignore", category=exceptions.DeprecationWarning)

should not see the warning.

Discussed this on irc yesterday without conclusion, so I thought I'd file a bug
with a patch. The wording for the warning is what gjc suggested
Comment 1 Mark McLoughlin 2005-08-02 11:25:52 UTC
Created attachment 50124 [details] [review]
pygtk-type-register-deprecation-warning.patch
Comment 2 Gustavo Carneiro 2005-08-02 11:29:53 UTC
+1 from me
Comment 3 Johan (not receiving bugmail) Dahlin 2005-08-02 14:38:18 UTC
I guess it's fine. We can't actually do any better without breaking the API freeze.

Mark, feel free commit this
Comment 4 Mark McLoughlin 2005-08-02 14:49:24 UTC
2005-08-02  Mark McLoughlin  <mark@skynet.ie>

        Fixes bug #312337

        * gobject/gobjectmodule.c: (_wrap_pyg_type_register):
        Make the "already registered" warning a deprecation warning
        with a more detailed hint on what it means.