[issue7526] tkinter menubutton underline behaviour varies between tkinter * and tkinter.ttk *
New submission from kurt : I am using the Menubutton to provide an accelerator effect via the underline option. When I import the basic widget via from tkinter import * the widget performs as expected (F_ile) is activated on pressing Alt+F and the menu is presented. Conversely when using the ttk widget via "from tkinter.ttk import *" the Alt+F key combination does not activate the Menubutton widget. In addition to this pressing F10 does not activate the menubar. This is on Ubuntu Karmic, Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22) [GCC 4.4.1] on linux2 By commenting out the import of the Menubutton at the top of the script you can hopefully see the behaviour I have described. This ApplicationMenu class is called in another script (self.root.MenuBar = ApplicationMenu(self.root)). -- components: Tkinter files: __init__.py messages: 96491 nosy: kurtforrester severity: normal status: open title: tkinter menubutton underline behaviour varies between tkinter * and tkinter.ttk * versions: Python 3.1 Added file: http://bugs.python.org/file15577/__init__.py ___ Python tracker <http://bugs.python.org/issue7526> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7526] tkinter menubutton underline behaviour varies between tkinter * and tkinter.ttk *
Changes by kurt : -- type: -> behavior ___ Python tracker <http://bugs.python.org/issue7526> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46446] OpenBSD not MULTIARCH
New submission from Kurt Mosiejczuk : Just like FreeBSD, MULTIARCH should not be passed to OpenBSD. Just add another line like done for FreeBSD -- components: Build messages: 411032 nosy: kmosiejczuk priority: normal severity: normal status: open title: OpenBSD not MULTIARCH type: compile error versions: Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.org/issue46446> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46446] OpenBSD not MULTIARCH
Change by Kurt Mosiejczuk : -- keywords: +patch pull_requests: +28912 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30721 ___ Python tracker <https://bugs.python.org/issue46446> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4699] Typo in documentation of "signal"
New submission from Kurt Mueller : in documentation of "signal" http://docs.python.org/library/signal.html - signal.SIG_DFL This is one of two standard signal handling options; it will simply perform the default function for the signal. For example, on most systems the default action for SIGQUIT is to dump core and exit, while the default action for SIGCLD is to simply ignore it. - Typo: SIGCLD should be SIGCHLD -- assignee: georg.brandl components: Documentation messages: 78050 nosy: georg.brandl, yam850 severity: normal status: open title: Typo in documentation of "signal" versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue4699> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Kurt Seifried added the comment: I have assigned CVE-2012-1150 for this issue as per http://www.openwall.com/lists/oss-security/2012/03/10/3 -- nosy: [email protected] ___ Python tracker <http://bugs.python.org/issue13703> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Changes by Kurt Seifried : -- nosy: [email protected] ___ Python tracker <http://bugs.python.org/issue13703> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32008] Example suggest to use a TLSv1 socket
New submission from Kurt Roeckx : Here: https://docs.python.org/3/library/ssl.html#ssl.SSLContext.check_hostname And here: https://docs.python.org/2/library/ssl.html#ssl.SSLContext.check_hostname It uses ssl.PROTOCOL_TLSv1, which is a bad example. Please change it to PROTOCOL_SSLv23 or PROTOCOL_TLS. (Those were the first 2 examples I could find via google on how to create an ssl connection using python.) -- assignee: docs@python components: Documentation messages: 306093 nosy: docs@python, kroeckx priority: normal severity: normal status: open title: Example suggest to use a TLSv1 socket type: enhancement ___ Python tracker <https://bugs.python.org/issue32008> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS
Kurt Roeckx added the comment: Note that the version in experimental only supports TLS 1.2 and 1.3 with the default config. It's moved from fixed in the code, to the default config file. I expect to upload that to unstable "soon", at which point people will be affected by this again. -- nosy: +kroeckx ___ Python tracker <https://bugs.python.org/issue31453> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS
Kurt Roeckx added the comment: The effect is the same as calling SSL_CTX_set_min_proto_version(). -- ___ Python tracker <https://bugs.python.org/issue31453> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32947] Support OpenSSL 1.1.1
Kurt Roeckx added the comment: This are the errors I'm currently getting testing with the pre9 verion in Debian: https://ci.debian.net/data/autopkgtest/testing/amd64/p/python2.7/865936/log.gz https://ci.debian.net/data/autopkgtest/testing/amd64/p/python3.6/865937/log.gz https://ci.debian.net/data/autopkgtest/testing/amd64/p/python3.7/865938/log.gz -- nosy: +kroeckx ___ Python tracker <https://bugs.python.org/issue32947> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32947] Support OpenSSL 1.1.1
Kurt Roeckx added the comment: This are automated tests for the packages in Debian. I uploaded the pre9 version to unstable, and as a result of that all reverse dependencies got tested. I don't have any experience with python myself. Anyway, the openssl.cnf in Debian contains: [system_default_sect] MinProtocol = TLSv1.2 CipherString = DEFAULT@SECLEVEL=2 So you might want to override that during the test suite by calling SSL_CTX_set_min_proto_version(ctx, 0). -- ___ Python tracker <https://bugs.python.org/issue32947> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32947] Support OpenSSL 1.1.1
Kurt Roeckx added the comment: Christian, Do you have any update on this? Any idea when we can expect relased python versions that work with OpenSSL 1.1.1? -- ___ Python tracker <https://bugs.python.org/issue32947> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32947] Support OpenSSL 1.1.1
Kurt Roeckx added the comment: Do you have any idea when the next release will be? I think python is currently our biggest blocker for getting OpenSSL 1.1.1 in Debian testing. -- ___ Python tracker <https://bugs.python.org/issue32947> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14579] Vulnerability in the utf-16 decoder after error handling
Kurt Seifried added the comment: Please use CVE-2012-2135 for this issue as per http://www.openwall.com/lists/oss-security/2012/04/25/3 -- nosy: [email protected] ___ Python tracker <http://bugs.python.org/issue14579> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14579] Vulnerability in the utf-16 decoder after error handling
Changes by Kurt Seifried : -- nosy: [email protected] ___ Python tracker <http://bugs.python.org/issue14579> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21546] int('\0') gives wrong error message
New submission from Kurt Rose:
int() ignores everything after a null byte when reporting an error message.
Here you can see an example of how this manifests, and why could be a problem.
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> int('a')
Traceback (most recent call last):
File "", line 1, in
ValueError: invalid literal for int() with base 10: 'a'
>>> int('\0a')
Traceback (most recent call last):
File "", line 1, in
ValueError: invalid literal for int() with base 10: ''
>>> int('abc\0def')
Traceback (most recent call last):
File "", line 1, in
ValueError: invalid literal for int() with base 10: 'abc'
--
components: Interpreter Core
messages: 218859
nosy: Kurt.Rose
priority: normal
severity: normal
status: open
title: int('\0') gives wrong error message
versions: Python 2.7
___
Python tracker
<http://bugs.python.org/issue21546>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20468] resource module documentation is incorrect
New submission from Kurt Rose: The documentation in the resource module for get_page_size() is incorrect. resource.getpagesize() Returns the number of bytes in a system page. (This need not be the same as the hardware page size.) This function is useful for determining the number of bytes of memory a process is using. The third element of the tuple returned by getrusage() describes memory usage in pages; multiplying by page size produces number of bytes. On Linux, the value returned in getrusage().ru_maxrss is in kilobytes. On OS-X it is in bytes. Ideally, this could be put into the documentation, but at least remove the inaccurate recommendation to multiply maxrss by page size :-) -- assignee: ronaldoussoren components: Macintosh messages: 209844 nosy: Kurt.Rose, ronaldoussoren priority: normal severity: normal status: open title: resource module documentation is incorrect versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker <http://bugs.python.org/issue20468> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6536] urllib2 howto contains typo
New submission from Kurt McKee : At <http://docs.python.org/dev/howto/urllib2.html>, "HHTPBasicAuthHandler" should of course be "HTTP..." -- assignee: georg.brandl components: Documentation messages: 90769 nosy: georg.brandl, kurtmckee severity: normal status: open title: urllib2 howto contains typo ___ Python tracker <http://bugs.python.org/issue6536> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5834] The word "error" used instead of "failure"
New submission from Kurt McKee : In the unittest documentation a distinction is made between the word "error" and "failure". However, the description for the TestCase.assertTrue() function reads: "Signal a test failure if expr is false; the explanation for the error..." The word "error" should instead read "failure" in order to maintain consistency with the words' uses throughout the rest of the documentation. -- assignee: georg.brandl components: Documentation messages: 86444 nosy: georg.brandl, kurtmckee severity: normal status: open title: The word "error" used instead of "failure" ___ Python tracker <http://bugs.python.org/issue5834> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9506] sqlite3 mogrify - return query string
New submission from Kurt Schwehr : Psycopg2 has a mogrify method on the cursor that returns the string that would be sent to the database for an execute. Any chance that could be added to pysqlite? It's definitely helpful for debugging and is a fantastic tool when teaching people databases. -- components: Extension Modules messages: 112790 nosy: goatbar priority: normal severity: normal status: open title: sqlite3 mogrify - return query string type: feature request versions: Python 2.7, Python 3.1 ___ Python tracker <http://bugs.python.org/issue9506> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22935] Disabling SSLv3 support
New submission from Kurt Roeckx: Hi, The attached patch makes python work when openssl doesn't have SSLv3 support. It also updates the documentation, which has already improved a lot since my original patch. The current upstream openssl when compiled with no-ssl2 it defines OPENSSL_NO_SSL2, drops the SSLv2_* method and drops support for SSLv2 in the SSLv23_* methods. When build with no-ssl3 it defines OPENSSL_NO_SSL3 and currently just drops supports for SSLv3 in the SSLv23_method, it does not yet drop the SSLv3_* methods. It's still being argued whether no-ssl3 should drop those symbols or that a new option will be used instead. So that means that with OPENSSL_NO_SSL3 defined it could be that the SSLv3_* methods still exist and that you can create a socket that only support SSLv3. I made the SSLv3 methods go away in python if OPENSSL_NO_SSL3 is defined. This at least makes things easier for the test suite so that you know you can test a combination like v3 with v23 or not. This patch is for 2.7. Please let me know if you need a patch for a different version. -- files: python2.7-nossl3.patch keywords: patch messages: 231624 nosy: kroeckx priority: normal severity: normal status: open title: Disabling SSLv3 support Added file: http://bugs.python.org/file37268/python2.7-nossl3.patch ___ Python tracker <http://bugs.python.org/issue22935> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22935] Disabling SSLv3 support
Kurt Roeckx added the comment: I know what I uploaded to Debian experimental. And I can't promise that I'll keep that define. I suggest you assume that NO_SSL3 will disable both. -- ___ Python tracker <http://bugs.python.org/issue22935> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22935] Disabling SSLv3 support
Kurt Roeckx added the comment: I've just signed the contributor agreement -- ___ Python tracker <http://bugs.python.org/issue22935> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22935] Disabling SSLv3 support
Kurt Roeckx added the comment: I did update the documentation to mention that, but it seems none of my documentation changes got applied. -- ___ Python tracker <http://bugs.python.org/issue22935> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22935] Disabling SSLv3 support
Kurt Roeckx added the comment: So this seems to be a function that just gets the certificate? You need to be careful with this since a server could perfectly decide to send a different certificate depending on the client hello it receives. Like if you support ECDSA it might decide to send you the ECDSA certificate instead of the RSA certificate. Or maybe you're even connecting to a different IP address? In any case, you should always use SSLv23, stop supporting anything else. -- ___ Python tracker <http://bugs.python.org/issue22935> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22935] Disabling SSLv3 support
Kurt Roeckx added the comment: SSLv3 does not support the TLS extensions so it's going to send a totally different Client Hello. It will for instance not indicate with elliptic curves it supports. So yes the behavior for SSLv3 and SSLv23 can be totally different. But even with both SSLv23 and a different cipher list you can get a different certificate. So what I'm really saying is that if you have an API to get a certificate that creates a new connection and you can set the options for that connection too that you need to document that properly that you might get a different certificate. -- ___ Python tracker <http://bugs.python.org/issue22935> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22935] Disabling SSLv3 support
Kurt Roeckx added the comment: Most such sites actually seem to have dropped support for SSLv3. One site where it depends on the cipher string is bugs.cdburnerxp.se -- ___ Python tracker <http://bugs.python.org/issue22935> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24169] sockets convert out-of-range port numbers % 2**16
New submission from Kurt Rose:
This appears to affect all versions of Python. In a behavior inherited from C,
TCP ports that are > 2 bytes are silently truncated.
Here is a simple reproduction:
>>> socket.create_connection( ('google.com', 2**16 + 80) )
Needs more investigation, but one likely place to make the fix is here:
https://hg.python.org/cpython/file/9d2c4d887c19/Modules/socketmodule.c#l1535
if (!PyArg_ParseTuple(args, "O&i:getsockaddrarg",
idna_converter, &host, &port))
Instead of parsing port with i, use H. This is a deep change to the behavior,
but I think it is very unlikely that users intentionally mean to pass a TCP
port > 2**16. More likely, this is silently swallowing errors.
There no indication that the passed port parameter is not being used for the
actual TCP communication (which is physically impossible because TCP only has a
2 byte port field).
In fact, the socket will continue to "lie" to the user and obfuscate the actual
port being used if getsockname() is called:
>>> socket.create_connection( ('google.com', 2**16 + 80) ).getsockname()
('10.225.89.86', 54899)
--
messages: 242987
nosy: Kurt.Rose
priority: normal
severity: normal
status: open
title: sockets convert out-of-range port numbers % 2**16
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
___
Python tracker
<http://bugs.python.org/issue24169>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24169] sockets convert out-of-range port numbers % 2**16
Kurt Rose added the comment:
I was incorrect -- the result of getsockname() appears to be some garbage port:
>>> socket.create_connection( ('google.com', 2**16 + 80) ).getsockname()
('10.225.89.86', 56446)
>>> socket.create_connection( ('google.com', 2**16 + 80) ).getsockname()
('10.225.89.86', 56447)
>>> socket.create_connection( ('google.com', 2**16 + 80) ).getsockname()
('10.225.89.86', 56448)
>>> socket.create_connection( ('google.com', 2**16 + 80) ).getsockname()
('10.225.89.86', 56449)
>>> socket.create_connection( ('google.com', 2**16 + 80) ).getsockname()
('10.225.89.86', 56450)
>>> socket.create_connection( ('google.com', 2**16 + 80) ).getsockname()
('10.225.89.86', 56451)
>>> socket.create_connection( ('google.com', 2**16 + 80) ).getsockname()
('10.225.89.86', 56452)
Java's stdlib gives a proper error message:
>>> java.net.Socket("google.com", 2**16 + 80)
Traceback (most recent call last):
File "", line 1, in
at java.net.InetSocketAddress.(Unknown Source)
at java.net.Socket.(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.python.core.PyReflectedConstructor.constructProxy(PyReflectedCons
tructor.java:210)
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: port out
of range:65616
The .NET runtime also rejects invalid ports:
>>> System.Net.IPEndPoint(0x7F01, 2**16 + 80)
Traceback (most recent call last):
File "", line 1, in
ValueError: Specified argument was out of the range of valid values.
Parameter name: port
IronPython by extension rejects the invalid port:
>>> socket.create_connection( ('google.com', 2**16 + 80) )
Traceback (most recent call last):
File "", line 1, in
ValueError: Specified argument was out of the range of valid values.
Parameter name: port
However, Jython recreates the behavior of CPython:
>>> socket.create_connection( ('google.com', 2**16 + 80) ).getsockname()
(u'10.225.89.86', 63071)
--
___
Python tracker
<http://bugs.python.org/issue24169>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24169] sockets convert out-of-range port numbers % 2**16
Kurt Rose added the comment:
Sorry, dumb mistake on my part. I should have been calling getpeername(), not
getsockname()
In that case the result is 80:
>>> socket.create_connection( ('google.com', 2**16 + 80) ).getpeername()
('74.125.239.41', 80)
The "random" ports were the client-side ephemeral ports.
--
___
Python tracker
<http://bugs.python.org/issue24169>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24169] sockets convert out-of-range port numbers % 2**16
Kurt Rose added the comment: Totally agree this needs to be managed carefully. My goal here was just to raise awareness and see if there is consensus that the behavior should be changed. I came across this because an upstream process had a bug which led to impossible TCP ports being specified. So, for my use case it would have been better if create_connection() had rejected the invalid data. If we are talking about enhancements to the socket module, it would also be nice if errors included the address :-) -- ___ Python tracker <http://bugs.python.org/issue24169> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24169] sockets convert out-of-range port numbers % 2**16
Kurt Rose added the comment:
I think this may in fact be a bug. There are other places in the socket module
where port is checked, create_connection() just seems to have been missed.
create_connection() and socket.connect() have different behavior:
>>> socket.create_connection( ('google.com', 0x1 + 80) )
>>> socket.socket().connect( ('google.com', 0x1 + 80) )
Traceback (most recent call last):
File "", line 1, in
File "C:\Python27\lib\socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
OverflowError: getsockaddrarg: port must be 0-65535.
https://hg.python.org/cpython/file/712f246da49b/Modules/socketmodule.c#l1395
if (port < 0 || port > 0x) {
PyErr_SetString(
PyExc_OverflowError,
"getsockaddrarg: port must be 0-65535.");
return 0;
}
--
___
Python tracker
<http://bugs.python.org/issue24169>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28250] typing.NamedTuple instances are not picklable Two
New submission from Kurt Dally: Creating a namedtuple and an instance of the namedtuple in a function then returning the instance to the global namespace made the instance unpickleable, as in Issue25665. -- components: Library (Lib) messages: 277236 nosy: Kurt priority: normal severity: normal status: open title: typing.NamedTuple instances are not picklable Two versions: Python 3.5 ___ Python tracker <http://bugs.python.org/issue28250> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28250] typing.NamedTuple instances are not picklable Two
Kurt Dally added the comment: My bad, I searched and found the issue, it very closely fit mine and the pickle module is new to me. I hadn't yet got through the details of pickling. Thanks for catching that. Kurt From: Mark Dickinson To: [email protected] Sent: Saturday, September 24, 2016 1:43 AM Subject: [issue28250] typing.NamedTuple instances are not picklable Two Mark Dickinson added the comment: I don't think this has anything to do with namedtuple; it's true whenever you create a class in an inner scope (rather than at module level). This is by design, and these restrictions are documented: https://docs.python.org/3.6/library/pickle.html#what-can-be-pickled-and-unpickled For example, running this script: import pickle def my_func(): class A: pass a = A() return a a = my_func() pickle.dumps(a) produces: Traceback (most recent call last): File "test.py", line 11, in pickle.dumps(a) AttributeError: Can't pickle local object 'my_func..A' -- nosy: +mark.dickinson resolution: -> not a bug status: open -> closed ___ Python tracker <http://bugs.python.org/issue28250> ___ -- ___ Python tracker <http://bugs.python.org/issue28250> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1721890] IDLE hangs in popup method completion
Kurt B. Kaiser added the comment: fixed at 53042. -- priority: high -> normal status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1721890> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1028] Tkinter binding involving Control-spacebar raises unicode error
New submission from Kurt B. Kaiser: The control-spacebar binding is used in IDLE to force open the completions window. It's causing IDLE to exit with a utf8 decode error. Attached is a Tkinter cut-down exhibiting the problem and a patch. The cutdown runs ok on 2.6 but not on py3k because the latter uses PyUnicode_FromString on all the arguments and errs out when it encounters a character outside the utf-8 range. Strangely, on my system, control-spacebar is sending a two byte string, C0E8 via the %A parameter. Control-2 does the same. Other keys with combinations of modifier keys send one byte. Linux trader 2.6.18-ARCH #1 SMP PREEMPT Sun Nov 19 09:14:35 CET 2006 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz GenuineIntel GNU/Linux Can the problem be confirmed? Using PyUnicode_FromUnicode on %A works because the unicode string is copied instead of decoded, and that parameter is supposed to be unicode, in any case. The patch fixes the problem on my system but should be reviewed, especially whether the cast in the call to PyUnicode_FromUnicode is suitably cross- platform. Assigning to Neal since he's working a lot of Unicode issues right now. I can check it in if I get approval. -- assignee: nnorwitz components: Tkinter files: tkintertest.py keywords: patch, py3k messages: 55311 nosy: kbk severity: normal status: open title: Tkinter binding involving Control-spacebar raises unicode error versions: Python 3.0 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1028> __ tkintertest.py Description: application/python ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1028] Tkinter binding involving Control-spacebar raises unicode error
Kurt B. Kaiser added the comment:
Heh, I see we have the same damn problem SF had: when a comment is
edited,
it doesn't re-wrap properly when submitted. You have to remove the
returns
manually after editing.
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1028>
__Index: Modules/_tkinter.c
===
--- Modules/_tkinter.c (revision 57515)
+++ Modules/_tkinter.c (working copy)
@@ -1897,7 +1897,7 @@
PythonCmd(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
{
PythonCmd_ClientData *data = (PythonCmd_ClientData *)clientData;
- PyObject *self, *func, *arg, *res;
+ PyObject *self, *func, *arg, *res, *s;
int i, rv;
Tcl_Obj *tres;
@@ -1914,7 +1914,12 @@
return PythonCmd_Error(interp);
for (i = 0; i < (argc - 1); i++) {
- PyObject *s = PyUnicode_FromString(argv[i + 1]);
+ if (11 == (i + 1)) { /* the %A arg is the unicode char */
+ s = PyUnicode_FromUnicode((Py_UNICODE *) argv[i + 1],
1);
+ }
+ else {
+ s = PyUnicode_FromString(argv[i + 1]);
+ }
if (!s || PyTuple_SetItem(arg, i, s)) {
Py_DECREF(arg);
return PythonCmd_Error(interp);
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1028] Tkinter binding involving Control-spacebar raises unicode error
Kurt B. Kaiser added the comment: Nope, you have to make sure not to type too wide. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1028> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1028] Tkinter binding involving Control-spacebar raises unicode error
Changes by Kurt B. Kaiser: __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1028> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1028] Tkinter binding involving Control-spacebar raises unicode error
Kurt B. Kaiser added the comment:
Well, maybe someday Tk will send a multibyte unicode
character. Update the patch.
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1028>
__Index: Modules/_tkinter.c
===
--- Modules/_tkinter.c (revision 57515)
+++ Modules/_tkinter.c (working copy)
@@ -1897,7 +1897,7 @@
PythonCmd(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
{
PythonCmd_ClientData *data = (PythonCmd_ClientData *)clientData;
- PyObject *self, *func, *arg, *res;
+ PyObject *self, *func, *arg, *res, *s;
int i, rv;
Tcl_Obj *tres;
@@ -1914,7 +1914,13 @@
return PythonCmd_Error(interp);
for (i = 0; i < (argc - 1); i++) {
- PyObject *s = PyUnicode_FromString(argv[i + 1]);
+ if (11 == (i + 1)) { /* the %A arg is the unicode char */
+ char *a = argv[i + 1];
+ s = PyUnicode_FromUnicode((Py_UNICODE *) a, strlen(a));
+ }
+ else {
+ s = PyUnicode_FromString(argv[i + 1]);
+ }
if (!s || PyTuple_SetItem(arg, i, s)) {
Py_DECREF(arg);
return PythonCmd_Error(interp);
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1028] Tkinter binding involving Control-spacebar raises unicode error
Kurt B. Kaiser added the comment: OK, thanks for the review! I suppose Tk is sending a bad string. r57540 -- status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1028> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1130] Idle - Save (buffer) - closes IDLE and does not save file (Windows XP)
Changes by Kurt B. Kaiser: -- assignee: -> kbk keywords: +py3k nosy: +kbk __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1130> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1718043] textView code cleanup
Kurt B. Kaiser added the comment: r58309. Thanks for the Patch! -- assignee: -> kbk nosy: +kbk resolution: -> accepted status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1718043> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1730217] IDLE - configDialog layout cleanup
Kurt B. Kaiser added the comment: r58310. Thanks for the nice patch! Looks better! -- assignee: -> kbk nosy: +kbk resolution: -> accepted status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1730217> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1529018] Move firewall warning to "about" menu
Kurt B. Kaiser added the comment: I think it would be better if a dialog popped up (before trying to set up the subprocess!) with the warning. It should have a checkbox, "Don't show this again." And it should be something we can reuse in other situations. Store a tag in the user's .idlerc if he doesn't want to see it again -- resolution: -> rejected _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1529018> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1225] IDLE - Fix: pressing Ctrl+C while printing exception -> stuck
Kurt B. Kaiser added the comment: r58396 Thanks for the patch! -- assignee: -> kbk priority: -> normal resolution: -> accepted status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1225> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1130] Idle - Save (buffer) - closes IDLE and does not save file (Windows XP)
Kurt B. Kaiser added the comment: r58398. Thanks for the report. Solution a little different than Tal Einat's. Please test. -- resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1130> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1775388] Display CallTips for classes using metaclasses.
Kurt B. Kaiser added the comment: Appears this was fixed at r55818, though with a typo. Module heavily rewritten since then to use the inspect module. The example below now works without further changes. -- resolution: -> out of date status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1775388> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1713252] character set in Japanese on Ubuntu distribution
Kurt B. Kaiser added the comment: absent further response, closing as unreproducible. -- assignee: -> kbk keywords: +patch nosy: +kbk resolution: fixed -> works for me status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1713252> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1710718] Ctrl+Shift block marking by words
Kurt B. Kaiser added the comment: Ctrl- right does jump to the ends. Behaviour is slightly strange, but useful. Let Tk handle it. -- keywords: +patch resolution: -> works for me status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1710718> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1691411] Duplicate "preferences" menu item/Tk Aqua 8.4.14
Changes by Kurt B. Kaiser: -- assignee: -> ronaldoussoren nosy: +ronaldoussoren _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1691411> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1691411] Duplicate "preferences" menu item/Tk Aqua 8.4.14
Changes by Kurt B. Kaiser: -- keywords: +patch _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1691411> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1725576] IDLE - cursor color configuration bug
Kurt B. Kaiser added the comment: r58403. Thanks for the patch! -- assignee: -> kbk nosy: +kbk resolution: -> accepted status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1725576> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1659326] Minor pasting patch
Kurt B. Kaiser added the comment: r58404. Thanks for the patch! -- assignee: -> kbk nosy: +kbk resolution: -> accepted status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1659326> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1130] Idle - Save (buffer) - closes IDLE and does not save file (Windows XP)
Kurt B. Kaiser added the comment: I caught the first part, but not the second using GNU/Linux. I think that eol_convention can be a class variable, since os.linesep isn't going to change from file to file. Thanks for the report! r58465. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1130> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1253] IDLE - Percolator overhaul
Kurt B. Kaiser added the comment: Thanks for the patch, it will definitely be applied once I finish reviewing it! Good job splitting off TkTextPercolator and inheriting from Delegator. -- assignee: -> kbk priority: -> normal __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1253> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1253] IDLE - Percolator overhaul
Kurt B. Kaiser added the comment: What change was required to allow Squeezer and ShellLogger to co-exist? __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1253> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1252] IDLE - patch Delegator to support callables
Kurt B. Kaiser added the comment: Despite your explanation, I don't understand what is being accomplished here. Delegates are not intended to be callable. They have methods, e.g. insert, which are callable, and the insert call is propagated down the chain by calls like (from ColorDelegator): def insert(self, index, chars, tags=None): index = self.index(index) self.delegate.insert(index, chars, tags) self.notify_range(index, index + "+%dc" % len(chars)) IMHO it's an incorrect usage of the Delegator mixin to affect the callable nature of the class to which it's being added. Also, this __call__ method, if actually used, propagates to the end of the Delegator chain and calls the function at the end, (assuming it is a function). Or it will skip non-callable Delegators and stop at the first callable one. I doubt this is what was intended, and people trying to understand the code will be further confused, it seems to me. Try adding delegator.txt (below) to your Delegator.py and running the module! I think this patch increases the complexity and obscurity of the Delegator/Percolator/WidgetRedirector code, rather than improving it. Apparently you want to sometimes call a chain of methods (as in current usage) and sometimes call a chain of functions. The semantic overload, which was bad enough already, is too great. If Squeezer and ShellLogger require this change, then I'd suggest changing them to match current Percolator usage, instead. Currently I don't see a Delegator being used in Squeezer. Could you be more specific about why the change is needed for those two extensions? Added file: http://bugs.python.org/file8604/delegator.txt __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1252> __class Hooker(Delegator): def __init__(self): Delegator.__init__(self) class Interceptor(Delegator): def __init__(self): Delegator.__init__(self) def fcn(): print "Fcn at base" if __name__ == "__main__": bottom = Hooker() bottom.setdelegate(fcn) middle = Hooker() middle.setdelegate(bottom) top = Interceptor() top.setdelegate(middle) print "top.delegate: ", top.delegate print "calling top(): ", top() ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1252] IDLE - patch Delegator to support callables
Kurt B. Kaiser added the comment:
First, I'm changing my mind about Percolator inheriting from
Delegator. A Percolator acts as a container for Delegators:
it "hasa" (chain) of them. But it fails "isa" Delegator.
It has no use for the Delegator's caching, and chaining
Percolators doesn't make sense. Inheriting from Delegator
just confuses things further, it seems to me.
Delegator is just a mixin implementing a node in the chain.
I do support splitting TkTextPercolator off Percolator.
> 3) make Delegator able to delegate direct calls
Except that the Delegator mixin doesn't know to what function
to delegate the call. Delegating a function call down the nodes
doesn't do anything, except possibly error out if the bottom
object isn't callable, as in delegator.txt.
> IMO, the nice thing about the Delegator class is that you can
> use an instance just as if it were the underlying object, transparently.
> The major exception from this behavior was that calling a Delegator
> never works, even if the underlying object is callable.
But it does work, if the filter that is using the Delegator mixin has
a __call__ method. See delegator2.txt above. Note that the Delegator
__call__ method is removed. You have to override the latter anyway
if you want to run some code in the filter. Do you have some
reason for mixing callable and non-callable filter instances in the
percolator chain?
I can see adding a __call__ method to Percolator, which would call
self.top(). Then each instance in the chain would have a __call__
to appropriate code.
We have two goals: solve your specific requirement of being able to
replace a method with a percolator, and increasing the clarity of the
existing WidgetRedirector/Delegator/Percolator code.
Yes, a Percolator already has semantic overload. Right now, there are
two ways to access the chain:
1. Since the delegate link is exposed, filters can directly call
specific methods further down the chain, e.g. self.delegate.index()
2. The caching and __getattr__() allows a "delegator" to call
unimplemented methods; they will be looked up on the chain. This
allows ColorDelegator to access its Text instance's methods without
having been passed a reference to the instance, as you noted.
Whether this adds or detracts from the clarity of the code is
debatable. Once you understand how it works, it's not a problem,
but it would be for people new to the code. Further, it's fragile,
since the first method with the correct name will be called.
Adding a __call__() method to Delegator doesn't seem to do anything
that can't be accomplished better by adding it to the class
implementing the filter. Why add complexity prematurely?
--
assignee: -> kbk
priority: -> normal
Added file: http://bugs.python.org/file8635/delegator2.txt
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1252>
__##
##def __call__(self, *args, **kw):
##return self.delegate(*args, **kw)
class Hooker(Delegator):
def __init__(self, name):
Delegator.__init__(self)
self.name = name
def my_fcn(self, caller):
print "Hooker %s called via %s" % (self.name, caller)
def __call__(self, *args, **kw):
self.my_fcn(*args)
self.delegate(*args, **kw)
class Interceptor(Delegator):
def __init__(self, name):
Delegator.__init__(self)
self.name = name
def my_fcn(self, caller):
print "Interceptor %s called via %s" % (self.name, caller)
def __call__(self, *args, **kw):
self.my_fcn(*args)
#self.delegate(*args, **kw) # uncomment to propagate
def fcn(caller):
print "Fcn at base called via %s" % caller
if __name__ == "__main__":
bottom = Hooker("bottom")
bottom.setdelegate(fcn)
middle = Hooker("middle")
middle.setdelegate(bottom)
top = Interceptor("top")
top.setdelegate(middle)
print "top: ", top
print "top.delegate: ", top.delegate
print "calling top()... "
top("top()")
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1252] IDLE - patch Delegator to support callables
Kurt B. Kaiser added the comment: I'll respond further shortly. In the meantime, please notice that Delegator3.py works the same whether or not your Delegator.__call__() method is commented out. That's because you needed to define __call__() methods in your filters. We are still suffering from semantic overload. Let's call the instances which are chained 'filters' and the Delegator mixin machinery 'nodes' for the purposes of this discussion (because they act much like the nodes in a traditional Lisp list). __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1252> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1717170] "Really print?" Dialog
Kurt B. Kaiser added the comment: r58700. Thanks for the patch! (Used OK/Cancel and simplified message.) -- assignee: -> kbk nosy: +kbk resolution: -> accepted status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1717170> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1262] IDLE does not start if windows environment variable containing 'German Umlaute: äöü' exists
Kurt B. Kaiser added the comment: I believe this is a duplicate of http://bugs.python.org/issue1342 and not related to IDLE. -- nosy: +kbk resolution: -> duplicate status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1262> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1356720] Ctrl+C for copy does not work when caps-lock is on
Kurt B. Kaiser added the comment: On systems other than Windows, people generally prefer to leave as much flexibility as possible by not binding various combinations of modifiers to the callback associated with a . If you need this change, add a binding as noamr suggests. -- resolution: -> wont fix status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1356720> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1004696] translate Windows cr-lf when installing scripts on Linux
Changes by Kurt B. Kaiser: -- assignee: kbk -> _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1004696> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1334] IDLE - Fix several highlighting bugs
Changes by Kurt B. Kaiser: -- assignee: -> kbk keywords: +patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1334> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1612746] Enhanced tabbed pane widget
Kurt B. Kaiser added the comment: Can I ask you for an update? This no longer applies cleanly with the recent changes to configDialog.py, and I suspect you might have some further cleanup. -- assignee: -> kbk nosy: +kbk resolution: -> out of date _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1612746> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1612746] Enhanced tabbed pane widget
Kurt B. Kaiser added the comment: Prior to the 13:17:41 update: r58710. Minor formatting changes. I figured you might have an update :-) It's good to let these new modules age a bit :-) Well, maybe not that long... renamed tabbedPages.py -> tabbedpages.py to conform to PEP 8. Nicely done, thanks for the patch! One comment: when multiple rows are created, the row order in the test widget, counting from the top, is 2341. I expected 1234. -- resolution: out of date -> accepted _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1612746> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1612746] Enhanced tabbed pane widget
Kurt B. Kaiser added the comment: Well, I already checked it in. Please synch to svn and send me an update against that. Note that I renamed tabbedPages.py. _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1612746> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1252] IDLE - patch Delegator to support callables
Kurt B. Kaiser added the comment: > 1) Should Delegator delegate calls to callables No, I agree they should. The question is whether it's necessary to add a __call__() method to the Delegator class. I claim you can do what you want to do without it. It serves only one purpose that I can see: you want to delegate to a callable by calling the instance at the top of the chain, and one of the chain members isn't callable. I don't see a use case for that, YAGNI. I'll defer the Percolator discussion for now. There is more to it than just the inheritance issue. I found your example1.py to be confusing. Please stop using the word 'delegator', it's too overloaded in this discussion! I marked up example1.py as example1a.py, changing some names and adding some comments. I also worked up example2.py which seems to cover the possible combinations of proxying functions, callables, and methods. It works without adding __call__() to Delegator. Please check it out, what more do you need? I'll be away until Sunday, so I can't respond further until then. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1252> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1252] IDLE - patch Delegator to support callables
Changes by Kurt B. Kaiser: Added file: http://bugs.python.org/file8668/example1a.py __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1252> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1252] IDLE - patch Delegator to support callables
Changes by Kurt B. Kaiser: Added file: http://bugs.python.org/file8669/example2.py __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1252> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1252] IDLE - patch Delegator to support callables
Kurt B. Kaiser added the comment: Further response to your 27Oct: > That's it. There is more. The Delegator mixin exposes its delegate attribute. Without that, it would not be possible to pass e.g. insert() down the chain because (in the case of the Text percolator) insert() is found in each filter and blocks 'transparent' access. I agree with your two use cases, but repeat that transparent access is dangerous in that the class in which the attribute is being looked up changes for each link on the chain. You could get unexpected results. IMO you are giving up stability for convenience. "Explicit is better than implicit." > (Caching is just an implementation detail, whose only purpose is to > facilitate changing a Delegator's delegate.) Don't believe everything you read. While that comment in the code is true, it's not the whole truth. If 'transparent' access is made to an attribute further down the chain, that attribute will be actually cached, i.e. be set as an attribute, in each DelegatorNode. I imagine this was done for performance reasons. The Delegator.__cache is used to determine which attributes to delete if a delegate is changed. I'll defer the Percolator comments until later. > Now, it seems to me that you aren't looking at Delegators and > Peroclators as transparent proxies at all. Not so. That's my 2. in my msg56862 27Oct. But I see filters as having two modes of operation. In the first, they take an action like insert() and share it explicitly along a chain of authority. Each link takes specific action, and passes insert() along. They also provide transparent access to attributes down the chain, as you note. But once an attribute is found it will not propagate unless explicitly passed along, and that requires the self.delegate attribute. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1252> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10907] OS X installer: warn users of buggy Tcl/Tk in OS X 10.6
Changes by Kurt B. Kaiser : -- nosy: +kbk ___ Python tracker <http://bugs.python.org/issue10907> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4676] python3 closes + home keys
Kurt B. Kaiser added the comment: Fixed in 2.7 and forward ported. -- assignee: -> kbk resolution: -> fixed stage: -> committed/rejected status: open -> closed type: -> crash versions: +Python 3.2, Python 3.3 -Python 2.6, Python 3.0 ___ Python tracker <http://bugs.python.org/issue4676> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3841] IDLE: quirky behavior when displaying strings longer than 4093 characters
Changes by Kurt B. Kaiser : -- assignee: -> kbk nosy: +kbk resolution: works for me -> out of date stage: -> committed/rejected status: pending -> closed ___ Python tracker <http://bugs.python.org/issue3841> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1028] Tkinter binding involving Control-spacebar raises unicode error
Kurt B. Kaiser added the comment: Tcl/Tk uses modified utf-8 internally. This includes using 0xC080, a multibyte Unicode null character, for embedded nulls that work with C's null terminated strings. Java does the same. Note that typing Ctrl-space and Ctrl-2 are conventional ways to enter a null from the keyboard. That's the reason a null char is associated with those key combinations. When Tcl exports Unicode, it is supposed to be strict utf-8. Until Tcl8.5, the %A (Unicode character corresponding to an event) was incorrectly leaking the modified Unicode null. _tkinter.c.2.patch is narrowly focused: if PythonCmd raises a UnicodeDecodeError and if the string passed in an arg is 0xC080, it is replaced with the Unicode null 0x00. -- assignee: ned.deily -> kbk components: +Unicode nosy: +kbk resolution: -> accepted Added file: http://bugs.python.org/file21954/tkinter.c.2.patch ___ Python tracker <http://bugs.python.org/issue1028> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1350] IDLE - CallTips enhancement - show full doc-string in new window
Kurt B. Kaiser added the comment: Rejecting for now, out of date, doesn't apply, not single topic. -- resolution: out of date -> rejected stage: test needed -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.org/issue1350> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1028] Tkinter binding involving Control-spacebar raises unicode error
Kurt B. Kaiser added the comment: r70039 3.1 forward ported > 3.2 > default. Will be in 3.2.1. -- resolution: accepted -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.org/issue1028> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1028] Tkinter binding involving Control-spacebar raises unicode error
Kurt B. Kaiser added the comment: Having a modified utf-8 codec will be useful. That said, it is an error for Tcl/Tk to expose modified utf-8 externally, and that was fixed at some point in Tk8.5. Since Tk is no longer sending 0xC080 for the %A char, switching codecs in _tkinter.c won't accomplish anything. This fix was to correct a long-standing problem in IDLE using Tk8.4, which is most easily solved by catching the leaked invalid null in _tkinter.c. It seems to me that, once you switch to modified utf-8 and allow the embedded nulls, you have to make sure everything you are doing uses the modified utf-8 encoding/decoding. -- ___ Python tracker <http://bugs.python.org/issue1028> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11896] Save on Close fails in IDLE, from Linux system
Kurt B. Kaiser added the comment: tkinter.messagebox.Message sending rather than str, so comparison with str failed. Always for "cancel", (almost?) always for "yes". Use the helper functions in tkinter.messagebox, which correct for that. This hasn't worked for a long time, I'm surprised it just came up. Will backport to 2.7. -- assignee: ned.deily -> kbk nosy: +kbk resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed versions: +Python 3.1, Python 3.3 -Python 2.6 ___ Python tracker <http://bugs.python.org/issue11896> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5559] IDLE Output Window 's goto fails when path has spaces
Kurt B. Kaiser added the comment: Backported to 2.6 4Oct09 56387:490190cb4a57 -- stage: commit review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.org/issue5559> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7738] IDLE hang when tooltip comes up in Linux
Kurt B. Kaiser added the comment: Linux trader 2.6.38-2-686 #1 SMP Thu Apr 7 05:24:21 UTC 2011 i686 GNU/Linux kbk@trader:~/Python/Py27$ aptitude show tk8.5 Package: tk8.5 ... Version: 8.5.9-2 Debian Linux Wheezy Can't reproduce on 2.7.1+ 3.1.4+ 3.2.1beta 3.3alpha0 with Tk8.4 Tk8.5 -- ___ Python tracker <http://bugs.python.org/issue7738> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2755] IDLE ignores module change before restart
Kurt B. Kaiser <[EMAIL PROTECTED]> added the comment: Thanks. Another question: when the shell starts, do you see the text No Subprocess to the right of the IDLE version, e.g. IDLE 2.6a3 No Subprocess __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2755> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2755] IDLE ignores module change before restart
Kurt B. Kaiser <[EMAIL PROTECTED]> added the comment: Sorry for the delay. OK, we are getting closer. Please tell me exactly how you start IDLE. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2755> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2755] IDLE ignores module change before restart
Kurt B. Kaiser <[EMAIL PROTECTED]> added the comment: Yes, removing the -n is the way to fix your problem. We went to quite a bit of effort to run user code from scratch on each Run/F5 using the subprocess. Running without the subprocess is considered 'expert' mode these days. (Although it's still used on Windows if the user edits a file via the right click menu - something we hope to fix.) There is a way around your difficulty - it involves using 'reload', but I didn't want to tell you about that too soon :-) Now I need to look at Debian/Ubuntu to find out why the switch was added. I run Debian, but not Ubuntu, and I use the command line pretty exclusively, so it didn't bite me. If this is the way the IDLE package is configured, I'm surprised the issue hasn't been reported previously. Thanks for the report! -- assignee: -> kbk __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2755> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2704] IDLE: Patch to make PyShell behave more like a Terminal interface
Changes by Kurt B. Kaiser <[EMAIL PROTECTED]>: -- keywords: +patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2704> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1948] Cant open python gui using VISTA
Kurt B. Kaiser <[EMAIL PROTECTED]> added the comment: No response from OP, closing. -- resolution: -> works for me status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1948> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2584] numeric overflow in IDLE
Kurt B. Kaiser <[EMAIL PROTECTED]> added the comment: When this is running, what happens if you hit Control-c a few times, especially in the first few seconds? Does it abort with a KeyboardInterrupt? Does it stop responding to Control-c after the window fills up? Note that IDLE slows down when very large quantities of text are printed to the shell window. This is an issue with the Tk library. The subprocess is supposed to exit when it notices that the socket has closed. This doesn't work well on Windows, unfortunately. We are thinking about it ;-) It doesn't seem that what you are attempting to fix has any realistic application. I don't run Vista. Check your resources right after you start your code. Is your system unresponsive because you are running out of memory or because you are using CPU 100%? Patient: My head hurts when I bang it against a wall. Doctor: So, don't do that! __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2584> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2913] idlelib/EditorWindow.py uses xrange()
Changes by Kurt B. Kaiser <[EMAIL PROTECTED]>: -- assignee: -> kbk nosy: +kbk __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2913> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2584] numeric overflow in IDLE
Kurt B. Kaiser <[EMAIL PROTECTED]> added the comment: BTW, instead of a reboot, use Task Manager (or whatever they needlessly renamed it to on Vista :) to kill all python processes. That should free up your machine. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2584> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2584] numeric overflow in IDLE
Changes by Kurt B. Kaiser <[EMAIL PROTECTED]>: -- resolution: -> wont fix status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2584> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2884] Create the tkinter package
Changes by Kurt B. Kaiser <[EMAIL PROTECTED]>: -- nosy: +kbk ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2884> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2775] Implement PEP 3108
Changes by Kurt B. Kaiser <[EMAIL PROTECTED]>: -- nosy: +kbk ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2775> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2917] merge pickle and cPickle in 3.0
Changes by Kurt B. Kaiser <[EMAIL PROTECTED]>: -- nosy: +kbk ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2917> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7881] Hardcoded path, unsafe tempfile in test_logging
Kurt B. Kaiser added the comment: In addition, the /tmp/tmp.txt file is only writeable by the user that created it. On the buildbot machine I'm admin'ing, the buildslave user created the file and user neal's run of build.sh on the trunk fails because it can't write the file. Also, to avoid clutter in /tmp, the file should not only be created safely as Neil suggests, but removed when the test is complete. -- nosy: +kbk ___ Python tracker <http://bugs.python.org/issue7881> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1374] IDLE - minor FormatParagraph bug fix
Kurt B. Kaiser added the comment: r59463 Thanks for the patch! -- resolution: -> accepted status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1374> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1252] IDLE - patch Delegator to support callables
Kurt B. Kaiser added the comment: Do you have any further comments on this issue? __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1252> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1612746] Enhanced tabbed pane widget
Kurt B. Kaiser added the comment: r59468 Thanks for the update! -- status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1612746> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1350] IDLE - CallTips enhancement - show full doc-string in new window
Kurt B. Kaiser added the comment: This is very useful! However, it isn't fully baked. Please test more before submitting patches. Try to break them on corner cases. import CallTips CallTips.CallTips( AttributeError: 'NoneType' object has no attribute 'splitlines' def foo(): pass foo( same error. There are two conditional blocks which need to go on separate lines. The jocular test in CallTipWindow needs to be changed to avoid needless controversy. Also, the doc window's first line isn't quite right. There may be other issues, but that's as far as I got. I would like to get this into 2.6a1. However, I completely rewrote CallTips.py for 3.0. I will need another version of the patch for the latter, can you supply it once we get 2.6 put to bed? -- assignee: -> kbk __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1350> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
