This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Text.edit_modified() fails
Type: Stage:
Components: Tkinter Versions: Python 2.3, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: loewis Nosy List: doko, ericpett, georg.brandl, gpolo, loewis, mkiever
Priority: normal Keywords: patch

Created on 2004-05-27 19:59 by ericpett, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
editModified.py mkiever, 2007-10-14 12:25
edit_modified_Issue961805.patch mkiever, 2007-10-14 12:26
edit_modified.diff gpolo, 2008-05-17 16:00 almost identical to edit_modified_Issue961805.patch
Messages (7)
msg20907 - (view) Author: Eric P. (ericpett) Date: 2004-05-27 19:59
Text.edit_modified() fails because it calls _getints() on the 
result of the underlying tk.call().  The tk.call() is returning a 
boolean, not a string, and the _getints() fails.

Here's the last part of an example traceback:

File "/usr/local/src/staff/pett/chimera/devel/Ilabel/
__init__.py", line 53, in textCB
    if not text.edit_modified():
  File "/usr/local/src/staff/chimera-build/IRIX-X11/foreign/
Python-2.3.2/lib/python2.3/lib-tk/Tkinter.py", line 2831, in 
edit_modified
    return self.edit("modified", arg)
  File "/usr/local/src/staff/chimera-build/IRIX-X11/foreign/
Python-2.3.2/lib/python2.3/lib-tk/Tkinter.py", line 2819, in 
edit
    return self._getints(
  File "/usr/local/src/staff/chimera-build/IRIX-X11/foreign/
Python-2.3.2/lib/python2.3/lib-tk/Tkinter.py", line 972, in 
_getints
    return tuple(map(getint, self.tk.splitlist(string)))
TypeError: coercing to Unicode: need string or buffer, bool 
found
msg20908 - (view) Author: Eric P. (ericpett) Date: 2004-05-27 20:52
Logged In: YES 
user_id=1051353

I should mention that it's the argless form of edit_modified() that
fails (querying the flag state) -- setting the flag works.
msg20909 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2007-02-14 20:18
followup from https://bugs.launchpad.net/bugs/84720



As a workaround you can get the status by calling:

print root.tk.call('eval','%s edit modified'%self.textwidget)

where self.textwidget is the variable where the text widget was assigned to.
msg56411 - (view) Author: Matthias Kievernagel (mkiever) * Date: 2007-10-14 12:25
Moved my patch from Issue1643641 to this Issue.
(duplication was created when moving from SF bugs/patches)
Patch to be applied with 'patch -p0'
I have also attached a demo where you can test
all Text.edit_* functions.

Regards,
Matthias Kievernagel
msg59761 - (view) Author: Matthias Kievernagel (mkiever) * Date: 2008-01-11 23:41
Retested revision 59927 from the trunk.
Error is still there, is demonstrated
by attached editModified.py (click 'modified?')
and patch is still applicable and corrects
the problem.

Regards,
Matthias Kievernagel
msg67004 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2008-05-17 16:00
From issue 1362475:

This bug still exists, I'm attaching a patch against current python-trunk.
This patch is based on the fact that documentation tk 8.4 (version which
edit command was added) and tk 8.5 says only edit_modified is supposed
to return something, which is either 0 or 1, so there was no reason to
use _gettints on that tk.call, and returning an empty tuple is against
the expected value, 0.

--- cut ---

This message and patch is almost a duplicate of Matthias, just updating
from the just closed, and duplicated, issue 1362475
msg67007 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-05-17 17:57
OK, committed patch as r63412.
History
Date User Action Args
2022-04-11 14:56:04adminsetgithub: 40299
2008-05-17 17:57:28georg.brandlsetstatus: open -> closed
nosy: + georg.brandl
resolution: fixed
messages: + msg67007
2008-05-17 16:00:26gpolosetfiles: + edit_modified.diff
nosy: + gpolo
messages: + msg67004
keywords: + patch
2008-05-17 15:58:04gpololinkissue1362475 superseder
2008-01-11 23:41:37mkieversetmessages: + msg59761
versions: + Python 2.6
2007-10-15 04:08:20georg.brandllinkissue1643641 superseder
2007-10-14 12:26:49mkieversetfiles: + edit_modified_Issue961805.patch
2007-10-14 12:25:23mkieversetfiles: + editModified.py
nosy: + mkiever
messages: + msg56411
2004-05-27 19:59:27ericpettcreate