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.
Bug 596076 - DeprecationWarning: use set_markup() instead even if no deprecation is on set_line_wrap in C library
Summary: DeprecationWarning: use set_markup() instead even if no deprecation is on set...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: pygtk2
Version: 6.0
Hardware: All
OS: Linux
high
low
Target Milestone: rc
: ---
Assignee: Matthew Barnes
QA Contact: desktop-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-26 09:30 UTC by Jan Pazdziora (Red Hat)
Modified: 2010-06-14 10:25 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-06-08 20:28:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Test script to show DeprecationWarning (501 bytes, text/plain)
2010-05-26 09:30 UTC, Jan Pazdziora (Red Hat)
no flags Details

Description Jan 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 2 Jan 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?

Comment 3 Matthew Barnes 2010-06-08 20:28:12 UTC
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 4 Jan Pazdziora (Red Hat) 2010-06-14 10:01:43 UTC
Alright. How do I achieve the set_line_wrap equivalent then?

Comment 5 Matthew Barnes 2010-06-14 10:25:34 UTC
As I said, build your own GtkDialog.


Note You need to log in before you can comment on or make changes to this bug.