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.
Created on 2006年10月20日 19:26 by reowen, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| text search bug.py | reowen, 2006年10月20日 19:26 | Script to demonstrate the problem | ||
| issue_1581476.diff | gpolo, 2009年01月02日 22:35 | |||
| Messages (9) | |||
|---|---|---|---|
| msg30329 - (view) | Author: Russell Owen (reowen) | Date: 2006年10月20日 19:26 | |
If Text search is called from a variable trace then the count variable is not be updated. I see this with Python 2.4.3 and Aqua Tcl/Tk 8.4.11 on MacOS X 10.4.7. I have not tested it elsewhere. Note that this works fine in tcl/tk so this appears to be a Tkinter issue. To see the problem run the attached python script. (The script also includes the equivalent tcl/tk code in its comments, so you can easily test the issue directly in tcl/tk if desired.) |
|||
| msg30330 - (view) | Author: Matthias Kievernagel (mkiever) * | Date: 2007年01月19日 20:50 | |
Same behaviour on Linux and current Python trunk.
In addition I get an IndexError, if I delete the
last character of the search string.
Does Tk allow calling search with an empty pattern?
Tkinter could handle this (with a correct result)
with the following change in Tkinter.py / Text.search():
if pattern[0] == '-': args.append('--')
->
if pattern and pattern[0] == '-': args.append('--')
Greetings,
Matthias Kievernagel
|
|||
| msg76861 - (view) | Author: Guilherme Polo (gpolo) * (Python committer) | Date: 2008年12月04日 01:22 | |
This is indeed a problem with Tkinter only, but I didn't check what is causing it yet. For the suggestion about fixing the search method regarding the pattern: the fix is almost fine, but we need to disallow None as a pattern. |
|||
| msg76881 - (view) | Author: Matthias Kievernagel (mkiever) * | Date: 2008年12月04日 13:05 | |
Nice to see someone working on this. One thing I've checked (iirc): You can set iVar in doSearch by hand like this: iVar.set(2) print 'iVar.get()', iVar.get() And iVar rests at this value. t.search does not change the value. I don't know anything about how the tcl-interpreter is embedded into python. I somehow had the impression there might be a _tkinter limitation there. Something like handling two callbacks into _tkinter at the same time or the tcl interpreter being unresponsive while calling a _tkinter function. At that point I gave up. Seen nothing obvious in _tkinter/Tkinter. Matthias Kievernagel (mkiever/at/web/dot/de) |
|||
| msg78895 - (view) | Author: Guilherme Polo (gpolo) * (Python committer) | Date: 2009年01月02日 22:35 | |
Fixed the issue now. _tkinter.call needs to use the TCL_EVAL_GLOBAL flag since all the variables in Tkinter are global variables. Matthias: your issue about the pattern should be placed in a different issue. |
|||
| msg79460 - (view) | Author: Matthias Kievernagel (mkiever) * | Date: 2009年01月09日 10:27 | |
>Matthias: your issue about the pattern should be placed in a >different >issue. Done as Issue4890. Appended a simplified copy of the demo program and a patch there. I do not understand your remark about None though (see new issue). Cheers, Matthias Kievernagel mkiever/at/web/dot/de |
|||
| msg80944 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2009年02月02日 15:47 | |
The patch looks fine, please apply. We should come up with a deprecation strategy for GlobalCall, though, since that function is now mostly redundant. |
|||
| msg80980 - (view) | Author: Guilherme Polo (gpolo) * (Python committer) | Date: 2009年02月02日 18:40 | |
Uhm, is it fine to remove it for good in 3.1 ? And then add a warning in 2.7 when it gets called which in turns just call Tkapp_Call ? |
|||
| msg80999 - (view) | Author: Guilherme Polo (gpolo) * (Python committer) | Date: 2009年02月02日 21:26 | |
Commited in r69217 (r69219), r69220, r69222, r69223 Martin, I will open another ticket about GlobalCall deprecation, later today. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:20 | admin | set | github: 44153 |
| 2009年02月02日 21:26:19 | gpolo | set | status: open -> closed resolution: accepted -> fixed messages: + msg80999 |
| 2009年02月02日 18:40:27 | gpolo | set | messages: + msg80980 |
| 2009年02月02日 15:47:46 | loewis | set | assignee: loewis -> gpolo |
| 2009年02月02日 15:47:37 | loewis | set | resolution: accepted messages: + msg80944 |
| 2009年01月09日 10:27:54 | mkiever | set | messages: + msg79460 |
| 2009年01月02日 22:35:31 | gpolo | set | files:
+ issue_1581476.diff keywords: + patch messages: + msg78895 versions: + Python 2.6, Python 3.0, Python 3.1, Python 2.7, - Python 2.4 |
| 2008年12月04日 13:05:58 | mkiever | set | messages: + msg76881 |
| 2008年12月04日 01:23:00 | gpolo | set | messages: + msg76861 |
| 2008年09月15日 17:39:27 | gpolo | set | nosy: + gpolo |
| 2006年10月20日 19:26:07 | reowen | create | |