Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionJan Pazdziora (Red Hat)
2010-05-26 09:30:08 UTC
Created attachment 416728[details]
Test script to show DeprecationWarning
Description of problem:
I have a code which tries to prevent line wrap by calling
dialog.label.set_line_wrap(False)
on RHEL 6, and pygtk2 (?) complains about the call being deprecated. Using set_property does not help either.
Colleagues at #desktop say that it is not marked as deprecated in C API, so I believe it should not be in python either.
Version-Release number of selected component (if applicable):
# rpm -q pygtk2
pygtk2-2.16.0-3.el6.i686
How reproducible:
Deterministic.
Steps to Reproduce:
1. Run the attached script with python.
Actual results:
/tmp/test_wrap.py:11: DeprecationWarning: use set_markup() instead
dialog.label.set_line_wrap(False)
/tmp/test_wrap.py:12: DeprecationWarning: use set_markup() instead
dialog.label.set_use_markup(True)
Expected results:
No DeprecationWarnings.
Additional info:
Comment 2Jan Pazdziora (Red Hat)
2010-05-26 09:33:32 UTC
I can avoid the set_use_markup by using
--- /tmp/test_wrap.py.orig 2010-05-26 11:31:27.581399590 +0200
+++ /tmp/test_wrap.py 2010-05-26 11:31:40.452312105 +0200
@@ -7,9 +7,9 @@
is not reflowed, so every even line is very short because it just has those ends.
"""
-dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, text)
+dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK)
dialog.label.set_line_wrap(False)
-dialog.label.set_use_markup(True)
+dialog.set_markup(text)
dialog.set_position (gtk.WIN_POS_CENTER)
dialog.show_all ()
(is that equivalent?) but what do I use instead of that set_line_wrap if I wanted to get rid of that call?
The deprecation warning is coming from your accessing "dialog.label", which is supposed to be private. See https://bugzilla.gnome.org/show_bug.cgi?id=309180.
GtkMessageDialog is rather restrictive in what it will let you do with the labels. You would probably be better off constructing an equivalent window out of GtkDialog, where you'd have full access to the label.
Closing this as NOTABUG since the deprecation is intentional.
Comment 4Jan Pazdziora (Red Hat)
2010-06-14 10:01:43 UTC
Alright. How do I achieve the set_line_wrap equivalent then?
Created attachment 416728 [details] Test script to show DeprecationWarning Description of problem: I have a code which tries to prevent line wrap by calling dialog.label.set_line_wrap(False) on RHEL 6, and pygtk2 (?) complains about the call being deprecated. Using set_property does not help either. Colleagues at #desktop say that it is not marked as deprecated in C API, so I believe it should not be in python either. Version-Release number of selected component (if applicable): # rpm -q pygtk2 pygtk2-2.16.0-3.el6.i686 How reproducible: Deterministic. Steps to Reproduce: 1. Run the attached script with python. Actual results: /tmp/test_wrap.py:11: DeprecationWarning: use set_markup() instead dialog.label.set_line_wrap(False) /tmp/test_wrap.py:12: DeprecationWarning: use set_markup() instead dialog.label.set_use_markup(True) Expected results: No DeprecationWarnings. Additional info: