[issue43333] utf8 in BytesGenerator
Chris added the comment: found this issue while googling the error. Also having the same problem with as_bytes() breaking on non-ascii characters. I've tried policy=policy.default.clone(utf8=True) but it gives the same error. My sample.py file attached contains a string sample email - which has a character \u200d (https://unicode-table.com/en/200D/) - Zero Width Joiner in the body. UnicodeEncodeError: 'ascii' codec can't encode character '\u200d' in position 70: ordinal not in range(128) Any assistance on what I can do to solve it would be great. It seems I can parse 99% of the emails I've tried but this one has me confused. -- nosy: +chrisstaunton1990 Added file: https://bugs.python.org/file50641/sample.py ___ Python tracker <https://bugs.python.org/issue4> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8668] Packaging: add a 'develop' command
Changes by chris : -- nosy: +chris ___ Python tracker <http://bugs.python.org/issue8668> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11413] Idle doesn't start
New submission from Chris : Hi, I just installed Python 3.1.1 via link in the book Python Programming for the absolute beginner third edition. But Idle won't start. When I try to open Idle the Windows "hourglass" just flash briefly but nothing happens after that. No error messages. My operating system is XP Professional Version 2002 Service Pack 3. I have uninstalled and reinstalled several times but nothing changes. I select "Install for All Users" during the installation. I have also tried installing instead the 3.2 version from the python.org website but the same issue arises - idle doesn't launch. Does anyone know what the problem is? Really want to get going with the program! -- components: IDLE messages: 130165 nosy: Chris priority: normal severity: normal status: open title: Idle doesn't start type: behavior versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue11413> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11413] Idle doesn't start
Chris added the comment: Hi, thank you for your reply. Â I try to start it directly from the start menu, where it jumped to after the first open attempt, and have also tried start menu -Â all programs - python - idle, then one click or right click then chosing open. Nothing works. Â The python (command line) opens, and python manuals, but not idle or module docs. --- On Mon, 3/7/11, Victor wrote: From: Victor Subject: [issue11413] Idle doesn't start To: ceonnbo...@yahoo.com Date: Monday, March 7, 2011, 1:33 PM Victor added the comment: How do you try to open the IDLE? For example, I open it from the start menu, python3.2. When you try to double click on a .py file, it is normal to see what you describe. -- nosy: +victorywin ___ Python tracker <http://bugs.python.org/issue11413> ___ -- Added file: http://bugs.python.org/file21038/unnamed ___ Python tracker <http://bugs.python.org/issue11413> ___Hi, thank you for your reply. I try to start it directly from the start menu, where it jumped to after the first open attempt, and have also tried start menu - all programs - python - idle, then one click or right click then chosing open. Nothing works. The python (command line) opens, and python manuals, but not idle or module docs. --- On Mon, 3/7/11, Victor <rep...@bugs.python.org> wrote: From: Victor <rep...@bugs.python.org>Subject: [issue11413] Idle doesn't startTo: ceonnbo...@yahoo.comDate: Monday, March 7, 2011, 1:33 PM Victor <http://us.mc598.mail.yahoo.com/mc/compose?to=victoryw...@yahoo.com"; ymailto="mailto:victoryw...@yahoo.com";>victoryw...@yahoo.com> added the comment:How do you try to open the IDLE? For example, I open it from the start menu, python3.2. When you try to double click on a .py file, it is normal to see what you describe.--nosy: +victorywin___Python tracker <http://us.mc598.mail.yahoo.com/mc/compose?to=rep...@bugs.python.org"; ymailto="mailto:rep...@bugs.python.org";>rep...@bugs.python.org><http://bugs.python.org/issue11413"; target=_blank>http://bugs.python.org/issue11413>___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11413] Idle doesn't start
Chris added the comment: Can you please guide me step by step - how and where exactly do I open a command prompt?  --- On Mon, 3/7/11, Amaury Forgeot d'Arc wrote: From: Amaury Forgeot d'Arc Subject: [issue11413] Idle doesn't start To: ceonnbo...@yahoo.com Date: Monday, March 7, 2011, 4:26 PM Amaury Forgeot d'Arc added the comment: Can you open a command prompt, and type:    c:\python32\python.exe -m idlelib.idle If there are messages, please paste them here! -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.python.org/issue11413> ___ -- Added file: http://bugs.python.org/file21048/unnamed ___ Python tracker <http://bugs.python.org/issue11413> ___Can you please guide me step by step - how and where exactly do I open a command prompt? --- On Mon, 3/7/11, Amaury Forgeot d'Arc <rep...@bugs.python.org> wrote: From: Amaury Forgeot d'Arc <rep...@bugs.python.org>Subject: [issue11413] Idle doesn't startTo: ceonnbo...@yahoo.comDate: Monday, March 7, 2011, 4:26 PM Amaury Forgeot d'Arc <http://us.mc598.mail.yahoo.com/mc/compose?to=amaur...@gmail.com"; ymailto="mailto:amaur...@gmail.com";>amaur...@gmail.com> added the comment:Can you open a command prompt, and type: c:\python32\python.exe -m idlelib.idleIf there are messages, please paste them here!--nosy: +amaury.forgeotdarc___Python tracker <http://us.mc598.mail.yahoo.com/mc/compose?to=rep...@bugs.python.org"; ymailto="mailto:rep...@bugs.python.org";>rep...@bugs.python.org><http://bugs.python.org/issue11413"; target=_blank>http://bugs.python.org/issue11413>___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11413] Idle doesn't start
Chris added the comment: Thank you, here is the message I got:   Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\Ceonn>c:\python32\python.exe -m idlelib.idle Traceback (most recent call last):  File "c:\python32\lib\runpy.py", line 160, in _run_module_as_main    "__main__", fname, loader, pkg_name)  File "c:\python32\lib\runpy.py", line 73, in _run_code    exec(code, run_globals)  File "c:\python32\lib\idlelib\idle.py", line 11, in    idlelib.PyShell.main()  File "c:\python32\lib\idlelib\PyShell.py", line 1374, in main    root = Tk(className="Idle")  File "c:\python32\lib\tkinter\__init__.py", line 1674, in __init__    self.tk = _tkinter.create(screenName, baseName, className, interactive, want objects, useTk, sync, use) _tkinter.TclError: Can't find a usable init.tcl in the following directories:    {C:\IBMTOOLS\Python22\tcl\tcl8.4} C:/IBMTOOLS/Python22/tcl/tcl8.5 c:/python3 2/lib/tcl8.5 c:/lib/tcl8.5 c:/lib/tcl8.5 c:/library c:/library c:/tcl8.5.9/libra ry c:/tcl8.5.9/library C:/IBMTOOLS/Python22/tcl/tcl8.4/init.tcl: version conflict for package "Tcl": ha ve 8.5.9, need exactly 8.4 version conflict for package "Tcl": have 8.5.9, need exactly 8.4    while executing "package require -exact Tcl 8.4"    (file "C:/IBMTOOLS/Python22/tcl/tcl8.4/init.tcl" line 19)    invoked from within "source C:/IBMTOOLS/Python22/tcl/tcl8.4/init.tcl"    ("uplevel" body line 1)    invoked from within "uplevel #0 [list source $tclfile]" This probably means that Tcl wasn't installed properly. --- On Tue, 3/8/11, Amaury Forgeot d'Arc wrote: From: Amaury Forgeot d'Arc Subject: [issue11413] Idle doesn't start To: ceonnbo...@yahoo.com Date: Tuesday, March 8, 2011, 9:26 AM Amaury Forgeot d'Arc added the comment: - Click the "Start" button - On this menu, click the "Run..." item (almost at the bottom) - In the small windows that opens, type "cmd" and click OK. This opens the command prompt. - In this window, type:   c:\python32\python.exe -m idlelib.idle To copy the output, you can open the menu by clicking on the icon on the top-left corner of the window; select "Edit", "Select All" and press Enter to copy all the window text into the clipboard. -- ___ Python tracker <http://bugs.python.org/issue11413> ___ -- Added file: http://bugs.python.org/file21049/unnamed ___ Python tracker <http://bugs.python.org/issue11413> ___Thank you, here is the message I got: Microsoft Windows XP [Version 5.1.2600](C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\Ceonn>c:\python32\python.exe -m idlelib.idleTraceback (most recent call last): File "c:\python32\lib\runpy.py", line 160, in _run_module_as_main "__main__", fname, loader, pkg_name) File "c:\python32\lib\runpy.py", line 73, in _run_code exec(code, run_globals) File "c:\python32\lib\idlelib\idle.py", line 11, in <module> idlelib.PyShell.main() File "c:\python32\lib\idlelib\PyShell.py", line 1374, in main root = Tk(className="Idle") File "c:\python32\lib\tkinter\__init__.py", line 1674, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)_tkinter.TclError: Can't find a usable init.tcl in the following directories: {C:\IBMTOOLS\Python22\tcl\tcl8.4} C:/IBMTOOLS/Python22/tcl/tcl8.5 c:/python32/lib/tcl8.5 c:/lib/tcl8.5 c:/lib/tcl8.5 c:/library c:/library c:/tcl8.5.9/library c:/tcl8.5.9/library C:/IBMTOOLS/Python22/tcl/tcl8.4/init.tcl: version conflict for package "Tcl": have 8.5.9, need exactly 8.4version conflict for package "Tcl": have 8.5.9, need exactly 8.4 while executing"package require -exact Tcl 8.4" (file "C:/IBMTOOLS/Python22/tcl/tcl8.4/init.tcl" line 19) invoked from within"source C:/IBMTOOLS/Python22/tcl/tcl8.4/init.tcl" ("uplevel" body line 1) invoked from within"uplevel #0 [list source $tclfile]" This probably means that Tcl wasn't installed properly. --- On Tue, 3/8/11, Amaury Forgeot d'Arc <rep...@bugs.python.org> wrote: From: Amaury Forgeot d'Arc <rep...@bugs.python.org>Subject: [issue11413] Idle doesn't startTo: ceonnbo...@yahoo.comDate: Tuesday, March 8, 2011, 9:26 AM Amaury Forgeot d'Arc <http://us.mc598.mail.yahoo.com/mc/compose?to=amaur...@gmail.com"; ymailto="mailto:amaur...@gmail.com";>amau
[issue11413] Idle doesn't start
Chris added the comment: In the Control Panel - System - Advanced - Environment Variables I find variables:  PYTHONCASEOK, --- On Tue, 3/8/11, Amaury Forgeot d'Arc wrote: From: Amaury Forgeot d'Arc Subject: [issue11413] Idle doesn't start To: ceonnbo...@yahoo.com Date: Tuesday, March 8, 2011, 10:43 AM Amaury Forgeot d'Arc added the comment: You certainly have a TCL_LIBRARY environment variable set on your system, it should be removed. For detailed instructions: http://mail.python.org/pipermail/python-list/2010-April/1241061.html -- ___ Python tracker <http://bugs.python.org/issue11413> ___ -- Added file: http://bugs.python.org/file21050/unnamed ___ Python tracker <http://bugs.python.org/issue11413> ___In the Control Panel - System - Advanced - Environment Variables I find variables: PYTHONCASEOK, --- On Tue, 3/8/11, Amaury Forgeot d'Arc <rep...@bugs.python.org> wrote: From: Amaury Forgeot d'Arc <rep...@bugs.python.org>Subject: [issue11413] Idle doesn't startTo: ceonnbo...@yahoo.comDate: Tuesday, March 8, 2011, 10:43 AM Amaury Forgeot d'Arc <http://us.mc598.mail.yahoo.com/mc/compose?to=amaur...@gmail.com"; ymailto="mailto:amaur...@gmail.com";>amaur...@gmail.com> added the comment:You certainly have a TCL_LIBRARY environment variable set on your system,it should be removed. For detailed instructions:http://mail.python.org/pipermail/python-list/2010-April/1241061.html"; target=_blank>http://mail.python.org/pipermail/python-list/2010-April/1241061.html--___Python tracker <http://us.mc598.mail.yahoo.com/mc/compose?to=rep...@bugs.python.org"; ymailto="mailto:rep...@bugs.python.org";>rep...@bugs.python.org><http://bugs.python.org/issue11413"; target=_blank>http://bugs.python.org/issue11413>___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11413] Idle doesn't start
Chris added the comment: Sent previous message before it was finished, will resend, got to go now though. --- On Tue, 3/8/11, Amaury Forgeot d'Arc wrote: From: Amaury Forgeot d'Arc Subject: [issue11413] Idle doesn't start To: ceonnbo...@yahoo.com Date: Tuesday, March 8, 2011, 10:43 AM Amaury Forgeot d'Arc added the comment: You certainly have a TCL_LIBRARY environment variable set on your system, it should be removed. For detailed instructions: http://mail.python.org/pipermail/python-list/2010-April/1241061.html -- ___ Python tracker <http://bugs.python.org/issue11413> ___ -- Added file: http://bugs.python.org/file21051/unnamed ___ Python tracker <http://bugs.python.org/issue11413> ___Sent previous message before it was finished, will resend, got to go now though.--- On Tue, 3/8/11, Amaury Forgeot d'Arc <rep...@bugs.python.org> wrote: From: Amaury Forgeot d'Arc <rep...@bugs.python.org>Subject: [issue11413] Idle doesn't startTo: ceonnbo...@yahoo.comDate: Tuesday, March 8, 2011, 10:43 AM Amaury Forgeot d'Arc <http://us.mc598.mail.yahoo.com/mc/compose?to=amaur...@gmail.com"; ymailto="mailto:amaur...@gmail.com";>amaur...@gmail.com> added the comment:You certainly have a TCL_LIBRARY environment variable set on your system,it should be removed. For detailed instructions:http://mail.python.org/pipermail/python-list/2010-April/1241061.html"; target=_blank>http://mail.python.org/pipermail/python-list/2010-April/1241061.html--___Python tracker <http://us.mc598.mail.yahoo.com/mc/compose?to=rep...@bugs.python.org"; ymailto="mailto:rep...@bugs.python.org";>rep...@bugs.python.org><http://bugs.python.org/issue11413"; target=_blank>http://bugs.python.org/issue11413>___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3962] single architecture framework build fails on OS X 10.5
New submission from Chris <[EMAIL PROTECTED]>: Hi, Our group ended up needing a non-universal x86_64 framework build because we had trouble building some modules with the non-framework build. We had to modify the makefile in two places to get it to work. First we fixed a place where configure generates '-arch_only i386'. That fixes the the build phase. Then we got rid of some install targets that were trying to pull in Carbon code. The first problem seems like it could easily be fixed by somebody who understands the configure script. I'm not sure what's going on with the second problem. Is --disable- toolbox-glue not being handled correctly when the install target is generated? It seems like the build phase is skipping the Carbon dependent extension modules correctly but install is trying to pull in modules that depend on those disabled modules. FYI, here's what were doing: ./configure --prefix=${HOME} --with-cxx-main='/usr/bin/mpicxx -arch x86_64'\ --enable-framework=${HOME} --disable-toolbox-glue CC='/usr/bin/mpicc -arch \ x86_64' CXX='/usr/bin/mpicxx -arch x86_64' LDFLAGS='-framework Accelerate \ -arch x86_64' Edit Makefile to replace -arch_only i386 with -arch_only x86_64 and remove frameworkinstallmaclib and frameworkinstallapps from the altinstall: target. diff Makefile Makefile~ 457c457 < -lSystem -lSystemStubs -arch_only x86_64 -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) - compatibility_version $(VERSION) -current_version $(VERSION) ;\ --- > -lSystem -lSystemStubs -arch_only i386 -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) - compatibility_version $(VERSION) -current_version $(VERSION) ;\ 741c741 < sharedinstall oldsharedinstall frameworkaltinstallunixtools --- > sharedinstall oldsharedinstall frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools Here is the svn info Path: . URL: http://svn.python.org/projects/python/trunk Repository Root: http://svn.python.org/projects Repository UUID: 6015fed2-1504-0410-9fe1-9d1591cc4771 Revision: 66613 Node Kind: directory Schedule: normal Last Changed Author: thomas.heller Last Changed Rev: 66611 Last Changed Date: 2008-09-24 13:26:05 -0500 (Wed, 24 Sep 2008) -- components: Macintosh messages: 73790 nosy: cekees severity: normal status: open title: single architecture framework build fails on OS X 10.5 type: compile error versions: Python 2.6 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3962> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4049] IDLE does not open at all
New submission from Chris <[EMAIL PROTECTED]>: IDLE just won't open in 2.6 for me. The command line works but not the GUI. It works in 2.5.2 though. I am a neophyte, any help is much appreciated. -- messages: 74357 nosy: Chris_L severity: normal status: open title: IDLE does not open at all versions: Python 2.6 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4049> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8086] ssl.get_server_certificate new line missing
New submission from Chris : I'm using ssl.get_server_certificate function. It returns a pem string. For each server I try, I get the string, but it is missing a newline "\n" before the -END CERTIFICATE- text. Any subsequent use of the string makes openssl throw up with a "bad end line" error. ssl.PEM_cert_to_DER_cert can be used, and, subsequently the der string can be used elsewhere. Example: >>> fncert = ssl.get_server_certificate(("freenode.net", 443), 3) >>> fncert '-BEGIN CERTIFICATE-\nMIICFTCCAX6gAwIBAgIBAjANBgkqhkiG9w0BAQUFADBVMRswGQYDVQQKExJBcGFj\naGUgSFRUUCBTZXJ2ZXIxIjAgBgNVBAsTGUZvciB0ZXN0aW5nIHB1cnBvc2VzIG9u\nbHkxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0wNzA1MDkxODM2MjVaFw0wODA1MDgx\nODM2MjVaMEwxGzAZBgNVBAoTEkFwYWNoZSBIVFRQIFNlcnZlcjEZMBcGA1UECxMQ\nVGVzdCBDZXJ0aWZpY2F0ZTESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3\nDQEBAQUAA4GNADCBiQKBgQDYqJO6X9uwU0AyJ6H1WgYCZOqpZvdI96/LaDumT4Tl\nD6QvmXzAbM4okSHU3FEuSqR/tNv+eT5IZJKHVsXh0CiDduIYkLdqkLhEAbixjX/1\nfdCtGL4X0l42LqhK4TMFT5AxxsP1qFDXDvzl/yjxo9juVuZhCeqFr1YDKBffCIAn\ncwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAG0zi/KyzHxSsLHfrwTFh9330TaGj/3H\nuvhmBUPC3FOxbIH2y5CG/Ddg46756cfaxKKiqJV3I4dAgatQybE65ELc3wOWgs4v\n4VDGsFKbkmBLuCgnFaY+p4xvr2XL+bJmpm8+IQqW5Ob/OUSl7Vj4btHhF6VK29CI\n+DexDLRI0KqZ-END CERTIFICATE-\n' Notice no "\n" before -END CERTIFICATE-\n Platform: Linux x64 python 2.6.4 -- messages: 100595 nosy: offero severity: normal status: open title: ssl.get_server_certificate new line missing type: behavior versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue8086> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8086] ssl.get_server_certificate new line missing
Chris added the comment: Did some more research and found this as the culprit: in Lib/ssl.py # ... def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None): ... return DER_cert_to_PEM_cert(dercert) def DER_cert_to_PEM_cert(der_cert_bytes): """Takes a certificate in binary DER format and returns the PEM version of it as a string.""" if hasattr(base64, 'standard_b64encode'): # preferred because older API gets line-length wrong f = base64.standard_b64encode(der_cert_bytes) return (PEM_HEADER + '\n' + textwrap.fill(f, 64) + PEM_FOOTER + '\n') else: return (PEM_HEADER + '\n' + base64.encodestring(der_cert_bytes) + PEM_FOOTER + '\n') Notice no '\n' before the PEM_FOOTER -- ___ Python tracker <http://bugs.python.org/issue8086> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4605] 3.0 documentation mentions using maketrans from within the string module.
New submission from chris <[EMAIL PROTECTED]>: http://docs.python.org/3.0/library/stdtypes.html#str.translate mentions the following: "You can use the maketrans() helper function in the string module to create a translation table." But maketrans is now a string method not just a function of the string module. It even mentions that right above it that it is now a method of string objects: "A map for translate() is usually best created by str.maketrans()." The page where this all appears in is: http://docs.python.org/3.0/library/stdtypes.html It may have just not been updated fully from an older release. If I am mistaken and this is not a bug, I appologise. -- assignee: georg.brandl components: Documentation messages: 77379 nosy: georg.brandl, suicideducky severity: normal status: open title: 3.0 documentation mentions using maketrans from within the string module. versions: Python 3.0 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4605> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39032] wait_for and Condition.wait still not playing nicely
New submission from Chris : This is related to https://bugs.python.org/issue22970, https://bugs.python.org/issue33638, and https://bugs.python.org/issue32751. I've replicated the issue on Python 3.6.9, 3.7.4, and 3.8.0. Looking at the source, I'm fairly sure the bug is still in master right now. The problem is yet another case of wait_for returning early, before the child has been fully cancelled and terminated. The issue arises if wait_for itself is cancelled. Take the following minimal example: cond = asyncio.Condition() async def coro(): async with cond: await asyncio.wait_for(cond.wait(), timeout=999) If coro is cancelled a few seconds after being run, wait_for will cancel the cond.wait(), then immediately re-raise the CancelledError inside coro, leading to "RuntimeError: Lock is not acquired." Relevant source code plucked from the 3.8 branch is as follows: try: # wait until the future completes or the timeout try: await waiter except exceptions.CancelledError: fut.remove_done_callback(cb) fut.cancel() raise if fut.done(): return fut.result() else: fut.remove_done_callback(cb) # We must ensure that the task is not running # after wait_for() returns. # See https://bugs.python.org/issue32751 await _cancel_and_wait(fut, loop=loop) raise exceptions.TimeoutError() finally: timeout_handle.cancel() Note how if the timeout occurs, the method waits for the future to complete before raising. If CancelledError is thrown, it doesn't. A simple fix seems to be replacing the "fut.cancel()" with "await _cancel_and_wait(fut, loop=loop)" so the behaviour is the same in both cases, however I'm only superficially familiar with the code, and am unsure if this would cause other problems. -- components: asyncio messages: 358307 nosy: asvetlov, criches, yselivanov priority: normal severity: normal status: open title: wait_for and Condition.wait still not playing nicely type: behavior versions: Python 3.6, Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue39032> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37625] Class variable is still accessible after class instance has been overwritten out
chris added the comment: Great content and outstanding, How can I start getting your https://logingit.com/www-txsurchargeonline-com-login-tx-surcharge-pay/";>newsletters in my email to enable keep track of your future content? Thank for this great piece. -- nosy: +Nadas ___ Python tracker <https://bugs.python.org/issue37625> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37625] Class variable is still accessible after class instance has been overwritten out
chris added the comment: Great and I look forward to getting more content. Incredibly great. https://logingit.com/dish-network-login/ -- ___ Python tracker <https://bugs.python.org/issue37625> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39466] Great
New submission from chris : How do I start creating my own code, is there tutorial for this? https://logingit.com/amazon-from-a-to-z-www-atoz-amazon-work/ -- messages: 360768 nosy: Nadas priority: normal severity: normal status: open title: Great ___ Python tracker <https://bugs.python.org/issue39466> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34309] Embedding Python; Py_Initialize / Py_Finalize cycles
New submission from chris : I'm linking an issue from numpy here: https://github.com/numpy/numpy/issues/8097 Embedding python suffers from a possibility to reliably reset the state of the python interpreter. For my use case, I noticed that when using numpy with Py_Initialize() and Py_Finalize(): Py_Initialize() // call code importing numpy Py_Finalize() Py_Initialize() // call same code again The above code will result in a crash. One of the comments in the referenced issue is that Py_Finalize doesn't unload loaded DLL's or shared objects. Doing that would probably fix the issues. As of now, embedding python is fundamentally broken for applications which want to embed non-trivial scientific python scripts involving user-adapted python code, because a) Py_Finalize cannot be used reliably b) There is no possibility to reliably reset the python interpreter otherwise (because the sub-interpreters are also not working reliably, which is stated in the documentation) c) manually reloading changed modules via importlib.reload is not a feasible solution The possibility to reset an embedded python interpreter to an initial state is a strong requirement for such applications. -- components: Extension Modules, Interpreter Core messages: 322876 nosy: christoph.wiedem...@hs-weingarten.de priority: normal severity: normal status: open title: Embedding Python; Py_Initialize / Py_Finalize cycles type: crash versions: Python 3.5 ___ Python tracker <https://bugs.python.org/issue34309> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34309] Embedding Python; Py_Initialize / Py_Finalize cycles
chris added the comment: Thanks for your comments and the link to the issue from the year 2000. > You mention "embedded python interpreter", but it sounds more like you mean > "embedded python runtime" Yes that's right. Sorry for imprecise wording. > Why is completely resetting Python "a strong requirement"? Because otherwise, if this is not an option, we need to restart the embedding C/C++ application whenever a python module is changed and need to be reloaded. This is occurring frequently in our use case and it is the main reason we want to embed python for rapid development purposes. (The application itself is a development environment for computer vision algorithms, where python is only one of multiple interacting, configurable plugins.) Being forced to restart the whole application on code changes compromises the advantage of using a scripting language without edit/compile/link steps to a degree which questions the whole idea. I'm not very confident in hacking reload(...) stuff in the modules. Interestingly enough, our use case matches exactly the one which has been described as unlikely in the original issue (https://bugs.python.org/issue401713#msg34524): the python runtime is dynamically loaded at runtime as a plugin :) I haven't tried it, but I suppose that we get the very same issues when we reload the plugin, because the dynamic libraries of extension modules are still loaded with an invalid state. Maybe using processes and some kind of socket / shared memory communication would suit our needs better, but this is also much more complicated and error-prone to implement than simply embedding python into the main process. -- ___ Python tracker <https://bugs.python.org/issue34309> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34309] Embedding Python; Py_Initialize / Py_Finalize cycles
chris added the comment: Okay, completely restarting python is not really necessary. Being able to reliably unload and later on re-import python modules (extension modules as well as pure python modules) in an embedded python runtime would solve my problems. One way to achieve that is currently Py_Initialize / Py_Finalize, but there are the drawbacks already mentioned. Another possibility is using sub-interpreters. If either of these could be fixed for extension modules (possibly with unloading the shared objects / DLL's :) ) I'd be fine. I completely understand your point about backporting and it is not an issue. -- ___ Python tracker <https://bugs.python.org/issue34309> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34309] Trouble when reloading extension modules.
chris added the comment: For short-term / mid-term we have now decided to start python as seperate process and interact with some kind of IPC. That leads to a limited interaction model between python and the embedded app but it has the advantage that unloading is possible (by simply restarting python). Hopefully, at some day python will have better support for unloading / reloading extension modules, but as some pointed out this will take time also until extension modules adopt new API discussed in the PEPs. Thanks for discussion and information! -- ___ Python tracker <https://bugs.python.org/issue34309> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15603] Multiprocessing creates incorrect pids
New submission from Chris: http://stackoverflow.com/questions/11884864/python-multiprocessing-creates-incorrect-pids Jesse Noller suggested that I submit this stack overflow as a bug so it can be examined. As the problem is kind of domain specific, it's not easy to come up with a test case that can reproduce the issue. Please let me know what more information I can provide. Thanks! -- messages: 167788 nosy: cfriedline priority: normal severity: normal status: open title: Multiprocessing creates incorrect pids type: crash versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue15603> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15603] Multiprocessing creates incorrect pids
Chris added the comment: That they don't appear in top. I was using that as a proxy for existence. I wrote a test case without R and realized (accidentally) that tracebacks will now flow up to the main process from the worker processes (which makes perfect sense, actually). I added explicit try/except to __get_valid_triplets. Will report back. -- ___ Python tracker <http://bugs.python.org/issue15603> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15603] Multiprocessing creates incorrect pids
Chris added the comment: Using top/'ps aux' is not the issue. I have code running now with the try/except. Will report back ASAP. I suspect that you're correct about something in the R pipeline failing. Hopefully, I'll get a good traceback. -- ___ Python tracker <http://bugs.python.org/issue15603> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15603] Multiprocessing creates incorrect pids
Chris added the comment: Also, when I said "...that tracebacks will now flow up to the main process from the worker processes (which makes perfect sense, actually)", I meant to say "...that tracebacks will NOT flow up to the main process from the worker processes (which makes perfect sense, actually)" ;-) -- ___ Python tracker <http://bugs.python.org/issue15603> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15603] Multiprocessing creates incorrect pids
Chris added the comment: Ugh, a server reboot seems to have cleared this all up (FML). It's been running well past the point of previous failure. I suppose I'll never know why it was failing. I'm going to close this out. Thanks for your time in helping me think this through. -- resolution: -> works for me status: open -> closed ___ Python tracker <http://bugs.python.org/issue15603> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19624] Switch constants in the errno module to IntEnum
Chris added the comment: I would be interested in tackling this as a first patch, can you give me some more information? -- nosy: +chrishood ___ Python tracker <http://bugs.python.org/issue19624> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19624] Switch constants in the errno module to IntEnum
Chris added the comment: I think I'll look for some other issues, this one looks a bit deep for a first patch. -- ___ Python tracker <http://bugs.python.org/issue19624> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5528] Unable to launch IDLE on Windows
New submission from Chris : I have recently installed python 2.6 and I have been successfully able to run python from a command line and from the Python command line. However, when I try to launch the IDLE, all I get is a window that flashes. I tried launching the IDLE from a command line with the following command: c:\Python26\Lib\idlelib>idle.py -n I get the following error: Traceback (most recent call last): File "C:\Python26\Lib\idlelib\idle.py", line 21, in idlelib.PyShell.main() File "C:\Python26\lib\idlelib\PyShell.py", line 1386, in main root = Tk(className="Idle") File "C:\Python26\lib\lib-tk\Tkinter.py", line 1643, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, want objects, useTk, sync, use) _tkinter.TclError: Can't find a usable init.tcl in the following directories: {C:\IBMTOOLS\Python22\tcl\tcl8.4} C:/IBMTOOLS/Python22/tcl/tcl8.5 C:/Python2 6/lib/tcl8.5 C:/lib/tcl8.5 C:/lib/tcl8.5 C:/library C:/library C:/tcl8.5.2/libra ry C:/tcl8.5.2/library C:/IBMTOOLS/Python22/tcl/tcl8.4/init.tcl: version conflict for package "Tcl": ha ve 8.5.2, need exactly 8.4 version conflict for package "Tcl": have 8.5.2, need exactly 8.4 while executing "package require -exact Tcl 8.4" (file "C:/IBMTOOLS/Python22/tcl/tcl8.4/init.tcl" line 19) invoked from within "source C:/IBMTOOLS/Python22/tcl/tcl8.4/init.tcl" ("uplevel" body line 1) invoked from within "uplevel #0 [list source $tclfile]" This probably means that Tcl wasn't installed properly. * I tried changing the python path from c:\IBMTOOLS\Python22 to C:\Python26, but that did not work. One other note is that I do not have adminstrator priviledges on this computer. -- components: IDLE messages: 83877 nosy: croy severity: normal status: open title: Unable to launch IDLE on Windows versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue5528> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5528] Unable to launch IDLE on Windows
Chris added the comment: Amaury, That worked, the variable was for IBMTools, so I am a little concerned that some other program may have issues. If I do have problems, I will just add the variable back. Thanks for getting back to me. - Chris - Original Message From: Amaury Forgeot d'Arc To: chrisa...@yahoo.com Sent: Thursday, March 26, 2009 11:21:08 AM Subject: [issue5528] Unable to launch IDLE on Windows Amaury Forgeot d'Arc added the comment: Do you happen to have a TCL_LIBRARY environment variable? If yes, I suggest to remove it. -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.python.org/issue5528> ___ -- ___ Python tracker <http://bugs.python.org/issue5528> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8872] if/else stament bug?
New submission from Chris : i am trying to learn to program in Python from a book on programming that says to use Python 3 i downloaded the Python 3.1.2 Windows x86 MSI installer for my machine aka an HP DV2500 running Win 7 it runs fine, but when i try to write the test program from my book i can't get past the if/else statement aka it gives me a syntax error when i get to the point of an if/else statement aka i program to ask the user to guess the number .. and then i try to create an if/else statement to print a you lose type statement if the input guess is not equal to the number specified by the program. for example i program the game to = 777 and print the you lose type message if the user's guess is not equal to 777, however i use the check module command from the run window in IDLE and it gave me a syntax error when i typed it the way the book said ... I've tried to figure this out myself but have had no success .. so i looked up if statements in the Python tutorials on python.org and tried that format and am still getting a syntax error -- components: IDLE, Windows files: hash.py messages: 106857 nosy: chrits55 priority: normal severity: normal status: open title: if/else stament bug? type: behavior versions: Python 3.1 Added file: http://bugs.python.org/file17515/hash.py ___ Python tracker <http://bugs.python.org/issue8872> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28558] argparse Incorrect Handling of Store Actions
New submission from Chris: argparse does not handle Store actions correctly when "nargs = 1" is provided. The documentation indicates the value should be assigned to the dest, but instead a list with the value as the only item is assigned to dest. -- files: test_argparse.py messages: 279686 nosy: Flux priority: normal severity: normal status: open title: argparse Incorrect Handling of Store Actions type: behavior versions: Python 2.7, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file45266/test_argparse.py ___ Python tracker <http://bugs.python.org/issue28558> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36225] [subinterpreters] Lingering subinterpreters should be implicitly cleared on shutdown
Change by Chris Roberts : -- nosy: +nasageek ___ Python tracker <https://bugs.python.org/issue36225> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44828] tkinter.filedialog linked with Tk 8.6.11 crashes on macOS 12 Monterey, breaking IDLE saves
Chris Satterlee added the comment: FYI, it appears that 8.6.11 works ok with MacOS 12.1 (released on 13-Dec-2021). 8.6.12 also works with MacOS 12.1. I have not tested either extensively, however. -- nosy: +csatt ___ Python tracker <https://bugs.python.org/issue44828> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46601] Instructions do not work
New submission from Chris Drake : See https://github.com/python/pythondotorg/issues/1774#issuecomment-1025250329 -- components: macOS messages: 412257 nosy: cryptophoto, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Instructions do not work versions: Python 3.11 ___ Python tracker <https://bugs.python.org/issue46601> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46601] macOS installer "Install Certificates.command" fails if pip is not installed
Chris Drake added the comment: So it looks like a dependency error in the installer then? It obviously makes no sense for pip to required before the python installer can work - chicken-and-egg issue - the installer should install what it needs of course, which I guess includes pip if that's really needed at this stage... -- ___ Python tracker <https://bugs.python.org/issue46601> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13305] datetime.strftime("%Y") not consistent for years < 1000
Chris Larson added the comment: Has there been any work/progress on this? Alternatively, what suggested work around/mitigations are suggested? -- nosy: +cklarson ___ Python tracker <https://bugs.python.org/issue13305> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46771] Add some form of cancel scopes
Chris Jerdonek added the comment: > I note that there is no documented way to retrieve the cancel message Does retrieving it from the CancelledError that is bubbling up suffice? Or do you need to be able to obtain it from the future object? -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue46771> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46771] Add some form of cancel scopes
Chris Jerdonek added the comment: > I'm not sure yet (if anything I'd need it for a task, not a future). (By future, I also meant task, as task inherits from future.) For now, I think it would be safer to get the message from the CancelledError, if possible, since how it gets there truly is an implementation detail. It would be okay to document that the msg argument gets passed to the CancelledError via the constructor, as that was always the intent. See also issue 45390 and the message I wrote there on how to make that API work better (given that the msg is only available from the leaf exception in the exception chain, and the current implementation creates intermediate exceptions, I believe unnecessarily): https://bugs.python.org/issue45390#msg403570 -- ___ Python tracker <https://bugs.python.org/issue46771> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.
Chris Jerdonek added the comment: Andrew, the approach I described would I feel be much better. It would result in more concise, less verbose tracebacks, as opposed to more verbose -- not just because the message won't be repeated, but also because it eliminates the unneeded creation of intermediate exceptions. It would also cause is checks to work, which is what we want since behaviorally it should be the same exception. -- ___ Python tracker <https://bugs.python.org/issue45390> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46829] Confusing CancelError message if multiple cancellations are scheduled
Chris Jerdonek added the comment: I don't really understand all the hate around the idea of a cancel message. One reason it's useful is that it provides a simple way to say *why* something is being cancelled or *what* is cancelling it. It provides additional context to the exception, in the same way that a normal exception's message can provide additional helpful context. Take for example this chunk of code: import asyncio import random async def job(): await asyncio.sleep(5) async def main(): task = asyncio.create_task(job()) await asyncio.sleep(1) r = random.random() if r < 0.5: task.cancel() else: task.cancel() await task if __name__=="__main__": asyncio.run(main()) Without passing a message, there's no way to tell which of the two lines called cancel, or why. The tracebacks are identical in both cases. This is even in the simplest case where only one cancellation is occurring. Passing a message lets one disambiguate the two call sites. And if there is truly a race condition where it's up in the air between two things cancelling it, I think it would be okay for the chosen message to be indeterminate, as either would have instigated the cancel in the absence of the other. -- ___ Python tracker <https://bugs.python.org/issue46829> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.
Chris Jerdonek added the comment: For future reference, with Andrew's change merged above, the traceback for the example snippet in my message above: https://bugs.python.org/issue45390#msg403570 is now the following. Observe that (1) the call to sleep() continues to be present, but (2) without introducing two new intermediate CancelledErrors, which increase the verbosity of the traceback: Traceback (most recent call last): File "/home/andrew/projects/cpython/exc_traceback.py", line 14, in asyncio.run(main()) ^^^ File "/home/andrew/projects/cpython/Lib/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) ^ File "/home/andrew/projects/cpython/Lib/asyncio/base_events.py", line 640, in run_until_complete return future.result() ^^^ File "/home/andrew/projects/cpython/exc_traceback.py", line 11, in main await task ^^ File "/home/andrew/projects/cpython/exc_traceback.py", line 5, in job await asyncio.sleep(5) ^^ File "/home/andrew/projects/cpython/Lib/asyncio/tasks.py", line 619, in sleep return await future asyncio.exceptions.CancelledError: cancel job (This is copied from Andrew's comment in the PR here: https://github.com/python/cpython/pull/31383#issuecomment-1046822899 ) Serhiy, can you provide a sample snippet for your case with output, like I did in my message linked above? -- ___ Python tracker <https://bugs.python.org/issue45390> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1765140] logging: delay_fh option and configuration kwargs
Chris Leary added the comment: Hi Vinay, I was actually trying to address a use case where the delay_fh option in the fileConfig() would be necessary. Let's say I'm running a simulator that I run many instances of at once. The logging configuration is extensive, so I want to use a configuration file; however, I don't want any existing log files to be clobbered as soon as I run fileConfig() -- I want to run fileConfig() to load the configuration, then remove/modify the handlers /before/ they touch the file handles. If fileConfig has no delay_fh option, fileConfig() would create the FileHandlers with delay_fh as False; therefore, adding the option to the FileHandler alone isn't enough to fix this use case. Let me know if this is unclear, or if I should provide a more concrete example. _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1765140> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1765140] logging: delay_fh option and configuration kwargs
Chris Leary added the comment: Ah, I see what the miscommunication is now. Yes, implementing the feature as you suggested would give the user the ability to specify the delayed handle-opening /within/ the configuration file. What I had intended was a way to load/inspect a file configuration without it having any handle-opening side affects, even if it were a totally unknown configuration file. If you want to assume a good trust relationship with the contents of a file configuration that you're loading (as in, you trust that it won't clobber any files that you still want), then that works well. I just assumed it would be useful to open a file configuration in an "untrusted" way (via delay_fh) in order to inspect/modify it. It seems to me to put more power in the hands of the loader of the configuration, rather than leaving the loader subject to the potentially "bad" contents of the configuration file. If you think I'm being too paranoid or feel that this is too obscure a use case, feel free to implement it how you see fit! :) _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1765140> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1243] option.dest not set when callback called with optparse
New submission from Chris Withers: The attached script demonstrates the bug. option.dest should be set, even if not explicitly supplied in the call to parser.add_option, by the time the callback is called. Unless dest='something' is specified in the call to add_option, you will get the following error when running "python test.py --myopt": File "test.py", line 4, in mycallback setattr(parser.values,option.dest,value) TypeError: attribute name must be string ...as options.dest is still None. I would expect options.dest to be computed as per the algorithm in optparse.Option._check_dest. -- components: Library (Lib) files: test.py messages: 56252 nosy: cjw296 severity: normal status: open title: option.dest not set when callback called with optparse versions: Python 2.3, Python 2.4, Python 2.5 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1243> __from optparse import OptionParser def mycallback(option,opt_str,value,parser): setattr(parser.values,option.dest,value) parser = OptionParser('bug demo') parser.add_option('--myopt',action='callback',callback=mycallback) options,args = parser.parse_args() ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1243] option.dest not set when callback called with optparse
Chris Withers added the comment: I'm not sure I fully understand where the fix should go but I'll put a note in to look into this. In the meantime, a good workaround is to supply an explicit destination: parser.add_option('--myopt',action='callback',callback=mycallback,dest='myopt') __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1243> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1243] option.dest not set when callback called with optparse
Chris Withers added the comment: But what type should I specify? I was using a callback to get a datetime object as an option... __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1243> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1251] ssl module doesn't support non-blocking handshakes
New submission from Chris Stawarz: The current version of the ssl module doesn't support non-blocking creation of SSLSocket objects. The reason for this is that the SSL handshaking (SSL_connect/SSL_accept) takes place during the construction of the SSLContext object (in newPySSLObject). This means that if the socket being wrapped is non-blocking, and the handshake fails with SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE, then the entire SSLContext is scrapped, and newPySSLObject must be run again in its entirety. Unfortunately, restarting from scratch on the same socket appears to confuse the remote host, and the new attempt fails. The attached patch fixes this problem by removing the handshaking code from newPySSLObject and adding a do_handshake method to SSLContext. It also adds a new parameter (do_handshake_on_connect) to the SSLSocket constructor and the wrap_socket function. The default value of the parameter is True, which preserves the current behavior of the module by immediately calling do_handshake after sslwrap. If do_handshake_on_connect is set to False, then the caller is responsible for calling do_handshake. This allows code that uses non-blocking sockets to first create the SSLSocket and then iteratively call do_handshake and select.select until the process completes (which is exactly how non-blocking reads and writes are handled). -- components: Documentation, Library (Lib), Tests files: ssl_nonblocking_handshake_patch.txt messages: 56295 nosy: chris.stawarz severity: normal status: open title: ssl module doesn't support non-blocking handshakes type: rfe versions: Python 2.6 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1251> __Index: Doc/library/ssl.rst === --- Doc/library/ssl.rst (revision 58397) +++ Doc/library/ssl.rst (working copy) @@ -54,7 +54,7 @@ network connection. This error is a subtype of :exc:`socket.error`, which in turn is a subtype of :exc:`IOError`. -.. function:: wrap_socket (sock, keyfile=None, certfile=None, server_side=False, cert_reqs=CERT_NONE, ssl_version={see docs}, ca_certs=None) +.. function:: wrap_socket (sock, keyfile=None, certfile=None, server_side=False, cert_reqs=CERT_NONE, ssl_version={see docs}, ca_certs=None, do_handshake_on_connect=True) Takes an instance ``sock`` of :class:`socket.socket`, and returns an instance of :class:`ssl.SSLSocket`, a subtype of :class:`socket.socket`, which wraps the underlying socket in an SSL context. @@ -98,6 +98,10 @@ See the discussion of :ref:`ssl-certificates` for more information about how to arrange the certificates in this file. + The parameter ``do_handshake_on_connect`` is a boolean that indicates whether a TLS/SSL + handshake should be initiated as soon as the socket is connected. If False, the + socket's :meth:`do_handshake` method must be called to perform a handshake. + The parameter ``ssl_version`` specifies which version of the SSL protocol to use. Typically, the server chooses a particular protocol version, and the client must adapt to the server's choice. Most of the versions are not interoperable @@ -289,7 +293,11 @@ number of secret bits being used. If no connection has been established, returns ``None``. +.. method:: SSLSocket.do_handshake() + Perform a TLS/SSL handshake. + + .. index:: single: certificates .. index:: single: X509 certificate Index: Lib/ssl.py === --- Lib/ssl.py (revision 58397) +++ Lib/ssl.py (working copy) @@ -86,7 +86,8 @@ def __init__(self, sock, keyfile=None, certfile=None, server_side=False, cert_reqs=CERT_NONE, - ssl_version=PROTOCOL_SSLv23, ca_certs=None): + ssl_version=PROTOCOL_SSLv23, ca_certs=None, + do_handshake_on_connect=True): socket.__init__(self, _sock=sock._sock) if certfile and not keyfile: keyfile = certfile @@ -101,11 +102,14 @@ self._sslobj = _ssl.sslwrap(self._sock, server_side, keyfile, certfile, cert_reqs, ssl_version, ca_certs) +if do_handshake_on_connect: +self.do_handshake() self.keyfile = keyfile self.certfile = certfile self.cert_reqs = cert_reqs self.ssl_version = ssl_version self.ca_certs = ca_certs +self.do_handshake_on_connect = do_handshake_on_connect def read(self, len=1024): @@ -189,6 +193,12 @@ self._sslobj = None socket.close(self) +def do_handshake(self): + +"""Perform a TLS/SSL handshake.""" + +self._sslobj.do_handshake() + def connect(self, addr):
[issue1251] ssl module doesn't support non-blocking handshakes
Chris Stawarz added the comment: Yeah, the pattern for doing non-blocking I/O with select() is different for SSL-wrapped sockets: You always have to try the potentially-blocking operation first, and then call select() and retry in response to SSL_ERROR_WANT_READ/WRITE. (You can also check SSL_pending(), but I don't think you really have to.) Also, unlike normal sockets, SSL-wrapped sockets *must* be set non-blocking. I can see how this pattern might not play nicely with asyncore. But I think this is a separate (though related) issue from the one I reported. As it's currently implemented, the ssl module provides no way of wrapping a socket without (potentially) blocking during the handshake, making it unusable by Twisted or any other package that requires all I/O to be non-blocking. Moving the handshaking into a separate method solves this problem. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1251> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1251] ssl module doesn't support non-blocking handshakes
Chris Stawarz added the comment: I meant that SSL-wrapped sockets must be set non-blocking in the case where you want to do non-blocking I/O with them using select(). This is another difference between SSL-wrapped sockets and normal sockets. With a normal socket, as long as you use select() to know when a read or write won't block, it shouldn't matter whether you've called setblocking(False) on the socket (although there may be corner cases where it does). With an SSL-wrapped socket, you have to try the I/O operation first, and then call select() if it fails with SSL_ERROR_WANT_READ/WRITE. But that won't happen if the socket is in blocking mode. In that case, the OpenSSL call will just block until the operation completes (or an error or disconnection occurs). That's my understanding, anyway, based on the OpenSSL man pages and my own usage. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1251> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1251] ssl module doesn't support non-blocking handshakes
Chris Stawarz added the comment: > The loop in _ssl.c/do_handshake will never return WANT_READ or > WANT_WRITE, so the loop in the test case, for instance, is > unnecessary. I don't know why you think that, but it's easy enough to show that this statement is incorrect. I've attached two scripts (nonblocking_handshake.py and blocking_handshake.py). The first does basically the same thing as my test case, but connecting to a different server and with some print statements added. Here's the output I get when I run it using an up-to-date trunk checkout with my patch applied: $ ../build/bin/python2.6 nonblocking_handshake.py starting handshake need read need read need read handshake complete The second reproduces the situation that led me to file this bug report in the first place. Here's what happens when I run it with an *unpatched* trunk build: $ ../build/bin/python2.6 blocking_handshake.py starting handshake need read Traceback (most recent call last): File "blocking_handshake.py", line 14, in s = ssl.wrap_socket(s,cert_reqs=ssl.CERT_NONE) File "/Users/cstawarz/Documents/Code/Python/svn/build/lib/ python2.6/ssl.py", line 466, in wrap_socket ssl_version=ssl_version, ca_certs=ca_certs) File "/Users/cstawarz/Documents/Code/Python/svn/build/lib/ python2.6/ssl.py", line 103, in __init__ cert_reqs, ssl_version, ca_certs) ssl.SSLError: [Errno 1] _ssl.c:429: error:04077068:rsa routines:RSA_verify:bad signature As you see, in both cases the handshaking fails with SSL_ERROR_WANT_READ. But without the fixes introduced by my patch, there's no way to handle the error. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1251> __import select import socket import ssl s = ssl.wrap_socket(socket.socket(socket.AF_INET), cert_reqs=ssl.CERT_NONE, do_handshake_on_connect=False) s.connect(('people.csail.mit.edu', 443)) s.setblocking(False) print 'starting handshake' while True: try: s.do_handshake() break except ssl.SSLError, err: if err.args[0] == ssl.SSL_ERROR_WANT_READ: print 'need read' select.select([s], [], []) elif err.args[0] == ssl.SSL_ERROR_WANT_WRITE: print 'need write' select.select([], [s], []) else: raise print 'handshake complete' s.close() import select import socket import ssl s = socket.socket(socket.AF_INET) s.connect(('people.csail.mit.edu', 443)) s.setblocking(False) print 'starting handshake' while True: try: s = ssl.wrap_socket(s, cert_reqs=ssl.CERT_NONE) break except ssl.SSLError, err: if err.args[0] == ssl.SSL_ERROR_WANT_READ: print 'need read' select.select([s], [], []) elif err.args[0] == ssl.SSL_ERROR_WANT_WRITE: print 'need write' select.select([], [s], []) else: raise print 'handshake complete' s.close() ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1251] ssl module doesn't support non-blocking handshakes
Chris Stawarz added the comment: Bill, You seem to be missing the whole point of doing non-blocking I/O, which is to handle multiple concurrent, I/O-bound tasks in a single OS thread. The application must be able to try the handshake, detect that it didn't complete because I/O needs to take place, and then retry it at a later time of its choosing (presumably when select() says it's OK to read from the socket). And between now and that later time, it can do other things, like read or write to other sockets. The point is that the *application* must have control over when it does I/O, when it waits for sockets to be ready for I/O, and what it does in between. There's just no way it can do this if the sslwrap() function doesn't return until the handshaking is complete. sslwrap() can't "do the right thing", because the right thing is to return control to the application until it's ready to try the handshake again. And this has nothing to do with the GIL or multiple threads. Like I said, the point of doing non-blocking I/O with select() is to *avoid* the need for multiple threads. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1251> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1502] itertools should grow chunkify
New submission from Chris Mellon: One of the most common requests in c.l.p and #python is a way to break an iterable up into some particular size chunks. For example, "abcdef" -> "ab", "cd", "ef". It's pretty easy to write one, but there are a few subtleties to it (like if you want padding or partial results) and it's so common that having it in the stdlib would be nice. Attached is a patch which implements itertools.chunkify. It can optionally discard, pad, or return any leftovers in the source iterable. Tests and docstrings are included, but it needs to be documented in the manual. One thing it does not do, but maybe it should, is guess what type the yielded values should have based on the input sequence - it always returns lists. Patch is against trunk, r59186. -- components: Library (Lib) files: chunkify.patch messages: 57861 nosy: arkanes severity: normal status: open title: itertools should grow chunkify type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file8811/chunkify.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1502> __ chunkify.patch Description: Binary data ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1518] Fast globals/builtins access (patch)
Chris Mellon added the comment: In funcobject.c:PyFunction_New, the declarations of op and __name__ need to be moved to the top of the function to compile in MSVC, and if accepted the fastglobals.c file needs to be added to PCBuild. In the test script, the use of import * generates syntax warnings that make the output awkward to read, and the benchmark for dict_get is actually running dict_set. I'm attaching the fixed copy of the test script I used. I see roughly the same speed ups (MSVC 7.1, Windows XP, Intel Core2 Duo @ 2.13Ghz), but I see a 10% slowdown in the dict-insert/delete and dict-set benchmarks which I find very troubling. TestTrunk fastglobalsTime difference -- Dict insert/del 2.0024954952.2074091251.102329134 Dict get0.7502532050.7455766620.993766714 Dict set0.9826959211.1149977661.13463152 Local get 0.5333870290.51337118 0.96247406 Local set 0.5965657740.6141249141.029433703 Global get 0.9356050730.7311365840.78145855 Global set 1.48638532 1.03868462 0.69879903 Builtin get 1.3926063670.7351806730.52791707 Function call 1.9387057811.7162330040.885246756 List comp 1.5477801051.1882157560.767690289 PyBench shows an overall slowdown - String mappings in particular, string/unicode predicates, and new instance creation all show significant slowdowns. The results are fairly verbose so I've uploaded them as a google docs spreadsheet at http://spreadsheets.google.com/ccc?key=p7g0z40g_NpvH5UpPTpr-Ag&hl=en I notice that you create a new PyFastGlobals object in every call to PyEval_EvalCode. This might explain some of the general case slowdown, is this really what you want to do? -- nosy: +arkanes Added file: http://bugs.python.org/file8823/fastglobals_test.py __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1518> __import timeit, new, time, dis MULTIPLIER = 1 def test_local_get(): x = 0 x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x def test_local_set(): x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0; x = 0 x = 0; x = 0;
[issue1518] Fast globals/builtins access (patch)
Chris Mellon added the comment: I may have had some old code in the build or something - I did a clean rebuild to look at some of the slowdowns and the fastglobals_test benchmarks are now even better than Neils. Pybench is still overall slower but it's mostly in float operations, which seems odd and I'd discount it unless someone else can recreate it. I've updated the spreadsheet I linked before with the updated timings, along with my microbenchmark and pystone results. Very impressive speedup on pystone, no doubt because of the heavy use of globals. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1518> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12961] unlabelled balls in boxes
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker <http://bugs.python.org/issue12961> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13238] Add shell command helpers to shutil module
Chris Rebert added the comment: Is format() really the best choice here, considering that {}s already have a meaning in the shell? -- nosy: +cvrebert ___ Python tracker <http://bugs.python.org/issue13238> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13245] sched.py kwargs addition and default time functions
New submission from Chris Clark : I ended up implementing my own sched.py equivalent as I needed kwargs support. This is my attempt to improve the stdlib, so I can throw my module way ;-) Added kwargs support, and made "argument" optional. "argument" is still named argument, I would like to rename this args but I'm unclear on the backwards compat rules for stdlib, in theory it should be fine unless someone has code that treats argument as a keyword arg). The scheduler init no long requires timer functions to be provided, it defaults to time.time, time.sleep as a helper to reduce repeated code for callers. This still allows callers to provide custom timer routines. I added a few (non exhaustive) tests for the new additions. It looks like there are a few pep8 improvements could be made to sched.py but I've not done that to reduce diffs and make it easier to see what I changed. Similar doc strings could be made more clear. I snuck in a hack to the test so that the full test suite isn't needed, I do not expect that to be accepted :-) I don't have enough network bandwidth to pull the whole hg repo so I ended up pulling the tip version for 2.7 of sched and its test (as of 2011-10-22 this is 5110d723fbb1) -- components: Library (Lib) files: kwargs_def_timer.patch keywords: patch messages: 146180 nosy: clach04 priority: normal severity: normal status: open title: sched.py kwargs addition and default time functions type: feature request versions: Python 2.7 Added file: http://bugs.python.org/file23496/kwargs_def_timer.patch ___ Python tracker <http://bugs.python.org/issue13245> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13318] Shelve second tier array subscript "[ ]" key creation doesn't work
New submission from Chris Piekarski : Shelve object second tier array subscript key generation doesn't behave the same way dictionary object do. >>> import shelve >>> x = shelve.open("tst1.shelve") >>> x["one"] = {} >>> x {'one': {}} >>> x["one"]["two"] = 2 >>> x {'one': {}} Whereas with a dictionary it works: >>> y = {} >>> y["one"] = {} >>> y["one"]["two"] = 2 >>> y {'one': {'two': 2}} -- components: None messages: 146816 nosy: cpiekarski priority: normal severity: normal status: open title: Shelve second tier array subscript "[ ]" key creation doesn't work type: behavior versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue13318> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Changes by Chris Miles : -- nosy: -chrismiles ___ Python tracker <http://bugs.python.org/issue13405> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10364] IDLE: make .py default added extension on save
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker <http://bugs.python.org/issue10364> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13535] Improved two's complement arithmetic support: to_signed() and to_unsigned()
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker <http://bugs.python.org/issue13535> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13658] Extra clause in class grammar documentation
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker <http://bugs.python.org/issue13658> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12857] Expose called function on frame object
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker <http://bugs.python.org/issue12857> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12760] Add create mode to open()
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker <http://bugs.python.org/issue12760> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9922] subprocess.getstatusoutput can fail with utf8 UnicodeDecodeError
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker <http://bugs.python.org/issue9922> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12029] ABC registration of Exceptions
Chris Rebert added the comment: Scouting around the CPython codebase a bit, I speculate that the cause of this behavior is that PyErr_GivenExceptionMatches() in errors.c uses PyType_IsSubtype() [which simply walks a class's __mro__ checking for pointer equality] rather than PyObject_IsSubclass()/PyObject_IsInstance() [which are smart enough to consult __subclasscheck__()/__instancecheck__() if they exist]. Of course, the more important issue here is whether this behavior is intended or not. I surmise python-dev needs to have a discussion about it? -- ___ Python tracker <http://bugs.python.org/issue12029> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11377] Deprecate platform.popen()
Chris Rebert added the comment: Slight tangent: Regarding os.popen()'s [documentation] status, there's a bug for that: http://bugs.python.org/issue9382 -- nosy: +cvrebert ___ Python tracker <http://bugs.python.org/issue11377> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12029] ABC registration of Exceptions
Chris Rebert added the comment: Surveying the docs, the current behavior *is* /technically/ correct (in a suspiciously precise way) according to the Language Reference: http://docs.python.org/dev/reference/compound_stmts.html#grammar-token-try_stmt : "For an except clause with an expression [...] the clause matches the exception if the resulting object is 'compatible' with the exception. An object is compatible with an exception if it is the class or a base class of the exception object" (which exactly describes what PyType_IsSubtype() checks for) The Tutorial is by contrast much more vague: http://docs.python.org/dev/tutorial/errors.html#handling-exceptions : "if [the raised exception's] type matches the exception named after the except keyword, the except clause is executed, and then execution continues after the try statement." No definition of what it means for the types to "match" seems to be given. -- ___ Python tracker <http://bugs.python.org/issue12029> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12173] PyImport_ImportModuleLevel doesn't have 'const' on its argument
New submission from Chris Angelico : An anomaly in the argument types of similar functions: PyImport_ImportModuleLevel takes char *, while the related functions PyImport_AddModule, PyImport_ImportModule, and PyImport_ImportModuleNoBlock all take const char *. This made a nuisance of itself for me when I tried to compile my code against Python.h (embedding Python). Attached is a relatively trivial patch to add const. Should not impact existing code, as the compiler will happily pass a char* to a const char* (just not the other way). -- components: Interpreter Core files: importconst.patch keywords: patch messages: 136829 nosy: Rosuav priority: normal severity: normal status: open title: PyImport_ImportModuleLevel doesn't have 'const' on its argument type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file22103/importconst.patch ___ Python tracker <http://bugs.python.org/issue12173> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12192] Doc that collection mutation methods return item or None
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker <http://bugs.python.org/issue12192> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6490] os.popen documentation in 2.6 is probably wrong
Chris Rebert added the comment: Per msg129958, attached is my stab at a patch to replace most uses of os.popen() with the subprocess module. The test suite passes on my Mac, but the patch does touch some specific-to-other-platform code, so further testing is obviously needed. This is my first non-docs patch, please be gentle. :) [Those patches were to subprocess' docs though!] Stuff still using os.popen() that the patch doesn't fix: - multiprocessing - platform.popen() [which is itself deprecated] - subprocess.check_output() - Lib/test/test_poll.py - Lib/test/test_select.py - Lib/distutils/tests/test_cygwinccompiler.py Also, I suppose Issue 9382 should be marked as a dupe of this one? -- nosy: +cvrebert Added file: http://bugs.python.org/file22188/mostly_replace_os_popen.patch ___ Python tracker <http://bugs.python.org/issue6490> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)
Chris Withers added the comment: Just got bitten by this as well, what still needs to happen with the patch? -- keywords: -easy nosy: +cjw296 ___ Python tracker <http://bugs.python.org/issue2202> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)
Chris Withers added the comment: Hmm, I'd argue it's a bug: File "/usr/lib64/python2.5/urllib2.py", line 972, in get_algorithm_impls return H, KD UnboundLocalError: local variable 'H' referenced before assignment ...does not say anything like: "The digest authentication scheme you have requested is not supported" Now, as to whether it's a bug that 'MD5-sess' isn't supported is a tougher call. The XXX indicates the intention was certainly for it to be supported... -- ___ Python tracker <http://bugs.python.org/issue2202> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)
Chris Withers added the comment: ...which is, of course, rather disappointing. When *would* md5-sess land? 2.7? 3.3?! -- ___ Python tracker <http://bugs.python.org/issue2202> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)
Chris Withers added the comment: Who with and where does the argument need to be had? -- ___ Python tracker <http://bugs.python.org/issue2202> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3177] implement os.startfile on posix and MacOSX
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker <http://bugs.python.org/issue3177> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1170] shlex have problems with parsing unicode
Changes by Chris Rebert : -- nosy: -cvrebert ___ Python tracker <http://bugs.python.org/issue1170> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1626300] 'Installing Python Modules' does not work for Windows
Chris Lambacher added the comment: I don't think that is the default state. You need to add .py to the PATHEXT environment variable: http://effbot.org/pyfaq/how-do-i-make-python-scripts-executable.htm Maybe Terry did this at some point? My windows box certainly does not have it and I have 2.6 and 2.7 installed. I don't have a 3.x install so I can't check if that is new in 3. -- nosy: +lambacck ___ Python tracker <http://bugs.python.org/issue1626300> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1626300] 'Installing Python Modules' does not work for Windows
Chris Lambacher added the comment: > Now my concern is about packaging: In a typical Windows install, can people > run “pysetup3 spam”? The windows installer does not make any additions to the path so it is unlikely that "pysetup3 spam" will work. There is http://www.python.org/dev/peps/pep-0397/ which addresses running scripts in a multi-version windows environment but I don't think that will help in this case. If you are running more than 1 version of windows there is simple statement that tells you how to install and have the install go to the right interpreter. You are almost best to have a shortcut that gives you a command prompt with the PATH variable correctly set to the desired python instance. That does not help the 2.x crowd or anyone before 3.3 :/ -- ___ Python tracker <http://bugs.python.org/issue1626300> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1626300] 'Installing Python Modules' does not work for Windows
Chris Lambacher added the comment: > I am not sure of the difference between 'local script' and 'global command' local script is the setup.py (or for that matter any other script in an arbitrary place in the filesystem. Global command is referring to something installed in %PYTHONINSTALLDIR%\scripts i.e. it is an installed command. This one operates on a specific version instance of python. I for instance have c:\python26\scripts\easy_install.exe and c:\python27\script\easy_install.exe and each of those operates on their own particular version. Neither are in my path. The current state is that I have to either put one of the scripts directories in my path or run easy_install with the full path. My understanding is that pysetup is a replacement for easy_install that will come with 3.3. > I am not sure what 'or does the installer add .py?' could mean. The Windows > installer? 'Add' to what? I was referring .py being added to the PATHEXT evironment variable. I think it is safe to say that has not happened and is likely a bad idea. -- ___ Python tracker <http://bugs.python.org/issue1626300> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10087] HTML calendar is broken
Chris Lambacher added the comment: Senthil: I think that would fundamentally make things worse. The HTML calendar apparently always provides a bytes type, but lets assume it provided you with unicode and we used sys.stdout.write on the output. Fundamentally you would get the same behavior as the patch provides since if you don't provide an encoding it uses sys.getdefaultencoding() which, IIUC is fundamentally what happens if you sys.stdout.write a unicode string. Ezio: I think it is highly unlikely that someone would be fiddling around with sys.stdout and then calling the main() function on calendar.main() (after setting up sys.args so that option parser gets the right parameters). -- ___ Python tracker <http://bugs.python.org/issue10087> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10087] HTML calendar is broken
Chris Lambacher added the comment: Senthil: I wasn't advocating the removal of the ability to specify encoding, only stating that avoiding the use of sys.stdout.buffer.write could only sensibly be done if we also removed the ability to specify an encoding (I can see how my wording might have been confusing). Earlier (msg122219) I said that we probably can't remove the encoding option because that would break backwards compatibility. FWIW, I think that the encoding parameter to the console program is probably sensible because there are no guarantees that the sys.getdefaultencoding() is actually set to the console encoding and I would guess that most people using the html option are not sending output to the console anyway. They are likely redirecting the output somewhere else because there is no "output this to a file" option. -- ___ Python tracker <http://bugs.python.org/issue10087> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue670664] HTMLParser.py - more robust SCRIPT tag parsing
Changes by Chris Palmer : -- nosy: -cpalmer ___ Python tracker <http://bugs.python.org/issue670664> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3244] multipart/form-data encoding
Changes by Chris Waigl : -- nosy: +Chris.Waigl ___ Python tracker <http://bugs.python.org/issue3244> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7950] subprocess.Popen documentation should contain a good warning about the security implications when using shell=True
Chris Rebert added the comment: Adjusted patch per R. David's comment. I obviously think it should be a full red warning box (that's how it is in my patch), but my opinion clearly isn't an outside one. Also, Ping/Bump on finally getting this applied. -- Added file: http://bugs.python.org/file18670/subprocess.rst.diff ___ Python tracker <http://bugs.python.org/issue7950> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9827] Clarify LogRecord documentation
New submission from Chris Leary : I tried to clear this section up a bit in light of the confusion here: http://stackoverflow.com/q/3687864/3594 Not sure if it applies to 3k trunk. First documentation patch, be sure to lmk what I'm doing wrong! :-) -- assignee: d...@python components: Documentation files: pyloggingdoc.diff keywords: patch messages: 116067 nosy: cdleary, d...@python priority: normal severity: normal status: open title: Clarify LogRecord documentation versions: Python 2.7 Added file: http://bugs.python.org/file18842/pyloggingdoc.diff ___ Python tracker <http://bugs.python.org/issue9827> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9827] Clarify LogRecord documentation
Chris Leary added the comment: Okay, neat! I put them in that order so that they would correspond to the parameters to ``LogRecord.__init__`` -- do we usually do alphabetical instead? -- ___ Python tracker <http://bugs.python.org/issue9827> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4761] create Python wrappers for openat() and others
Changes by Chris Gerhard : -- nosy: +Chris.Gerhard ___ Python tracker <http://bugs.python.org/issue4761> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6884] Impossible to include file in sdist that starts with 'build' on Win32
Chris Withers added the comment: This is a regex bug, and it just bit me again :-( Because of this bug, you cannot currently build a bdist_egg (and therefore cannot install with easy_install) http://pypi.python.org/pypi/buildout-versions on windows. The only choice I have is to rename the 'buildout_versions' package inside the distribution to something that doesn't start with 'build'. -- ___ Python tracker <http://bugs.python.org/issue6884> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6884] Impossible to include file in sdist that starts with 'build' on Win32
Chris Withers added the comment: So, the workaround I gave doesn't work, because this stupid regex still knocks out all the egg-info. The only solution is to use that accidentally employed by http://svn.plone.org/svn/collective/buildout/buildout.dumppickedversions/trunk/ and put any files starting with 'build' and that need to be used on Windows in a sub-folder. Here's a debug sdist build dump from buildout.dumppickedversions: Running setup script 'setup.py'. Distribution.parse_config_files(): options (after parsing config files): no commands known yet options (after parsing command line): option dict for 'aliases' command: {} option dict for 'sdist' command: {} running sdist Distribution.get_command_obj(): creating 'sdist' command object running egg_info Distribution.get_command_obj(): creating 'egg_info' command object writing requirements to src\buildout.dumppickedversions.egg-info\requires.txt writing src\buildout.dumppickedversions.egg-info\PKG-INFO writing namespace_packages to src\buildout.dumppickedversions.egg-info\namespace_packages.txt writing top-level names to src\buildout.dumppickedversions.egg-info\top_level.txt writing dependency_links to src\buildout.dumppickedversions.egg-info\dependency_links.txt writing entry points to src\buildout.dumppickedversions.egg-info\entry_points.txt Distribution.get_command_obj(): creating 'build_py' command object Distribution.get_command_obj(): creating 'build' command object include_pattern: applying regex r'^src\\buildout\.dumppickedversions\.egg\-info\.*[^/]*\Z(?ms)' adding src\buildout.dumppickedversions.egg-info\dependency_links.txt adding src\buildout.dumppickedversions.egg-info\entry_points.txt adding src\buildout.dumppickedversions.egg-info\namespace_packages.txt adding src\buildout.dumppickedversions.egg-info\not-zip-safe adding src\buildout.dumppickedversions.egg-info\PKG-INFO adding src\buildout.dumppickedversions.egg-info\requires.txt adding src\buildout.dumppickedversions.egg-info\SOURCES.txt adding src\buildout.dumppickedversions.egg-info\top_level.txt exclude_pattern: applying regex r'^build\.*' removing buildout.cfg exclude_pattern: applying regex r'^buildout\.dumppickedversions\-0\.5\.*' ... Now contrast with buildout_versions: Running setup script 'setup.py'. Distribution.parse_config_files(): options (after parsing config files): no commands known yet options (after parsing command line): option dict for 'aliases' command: {} option dict for 'sdist' command: {} running sdist Distribution.get_command_obj(): creating 'sdist' command object running egg_info Distribution.get_command_obj(): creating 'egg_info' command object writing requirements to buildout_versions.egg-info\requires.txt writing buildout_versions.egg-info\PKG-INFO writing top-level names to buildout_versions.egg-info\top_level.txt writing dependency_links to buildout_versions.egg-info\dependency_links.txt writing entry points to buildout_versions.egg-info\entry_points.txt Distribution.get_command_obj(): creating 'build_py' command object Distribution.get_command_obj(): creating 'build' command object include_pattern: applying regex r'^buildout\_versions\.egg\-info\.*[^/]*\Z(?ms)' adding buildout_versions.egg-info\dependency_links.txt adding buildout_versions.egg-info\entry_points.txt adding buildout_versions.egg-info\not-zip-safe adding buildout_versions.egg-info\PKG-INFO adding buildout_versions.egg-info\requires.txt adding buildout_versions.egg-info\SOURCES.txt adding buildout_versions.egg-info\top_level.txt exclude_pattern: applying regex r'^build\.*' removing buildout_versions.egg-info\top_level.txt removing buildout_versions.egg-info\SOURCES.txt removing buildout_versions.egg-info\requires.txt removing buildout_versions.egg-info\PKG-INFO removing buildout_versions.egg-info\not-zip-safe removing buildout_versions.egg-info\entry_points.txt removing buildout_versions.egg-info\dependency_links.txt removing buildout.cfg removing buildout_versions.egg-info\SOURCES.txt exclude_pattern: applying regex r'^buildout\-versions\-1\.4\.*' -- ___ Python tracker <http://bugs.python.org/issue6884> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6884] Impossible to include file in sdist that starts with 'build' on Win32
Chris Withers added the comment: Okay, so here's the patch: Change line 352 on distutils/filelist.py from: pattern_re = "^" + os.path.join(prefix_re, ".*" + pattern_re) To: pattern_re = "^"+prefix_re+re.escape(os.sep)+".*"+pattern_re os.path.join is is not always the saviour ;-) -- keywords: +needs review -patch ___ Python tracker <http://bugs.python.org/issue6884> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1236] subprocess is not thread-safe
Changes by Chris Gerhard : -- nosy: +Chris.Gerhard ___ Python tracker <http://bugs.python.org/issue1236> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7950] subprocess.Popen documentation should contain a good warning about the security implications when using shell=True
Chris Rebert added the comment: "the above Note" mentioned in those last two lines demonstrates shlex.split() and correct tokenization. -- ___ Python tracker <http://bugs.python.org/issue7950> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11398] http_proxy on windows won't function due to incorrect case handling
New submission from chris nojima : There is an issue where on windows os.environ keys are all uppercase. If i run set a="hello", in python it will appear as a key "A". urllib.request.getproxies_environment looks for all _proxy environment vars by looking for "_proxy". Since windows uppercases, it's impossible to set this var (it will be HTTP_PROXY and won't match, etc). This is stopping me from running some install scripts -- components: Library (Lib) messages: 130067 nosy: chris.nojima priority: normal severity: normal status: open title: http_proxy on windows won't function due to incorrect case handling type: behavior versions: Python 3.1, Python 3.2, Python 3.3 ___ Python tracker <http://bugs.python.org/issue11398> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11398] http_proxy on windows won't function due to incorrect case handling
chris nojima added the comment: Sorry. You are correct, this must have been fixed in 3.1.2. The box I was on had 3.1.1 on it and some other configuration issues led me to believe this was happening in 3.2 as well. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/issue11398> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3722] print followed by exception eats print with doctest
Chris Withers added the comment: Terry, My original post was not about *temporary* output inserted for debugging, but test mocks and the like which form a permanent part of the test and which output to stdout. cheers, Chris -- ___ Python tracker <http://bugs.python.org/issue3722> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11628] cmp_to_key generated class should use __slots__
New submission from Chris Colbert : The cmp_to_key func acts as a class factory for generating key objects that behave according to a user defined cmp function. Many patterns/libs that make use of key functions (for example blist and the SortedCollection recipe) store the the results of the key function internally to provide faster subsequent operations. For large datasets, the number of key objects can become large, and it makes sense to keep their memory footprint as small as possible. >From this stance, I propose to add "__slots__ = ('obj',)" to the class >definition of "K" in cmp_to_key to prevent the creation of the un-needed >instance dict and save the memory. I find it hard to conjure up a case where a user would need to weakref or add attributes to the return value of a key func. But should that need arise, that functionality could be provided as optional kwargs to cmp_to_key, or just have the user subclass the return value of cmp_to_key. Alternatively, the addition of __slots__ could be specified as a kwarg to cmp_to_key. I'd be happy to make a patch for any of these (or alternative) options. -- components: Library (Lib) messages: 131691 nosy: Chris.Colbert, ncoghlan, rhettinger priority: normal severity: normal status: open title: cmp_to_key generated class should use __slots__ type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker <http://bugs.python.org/issue11628> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11628] cmp_to_key generated class should use __slots__
Chris Colbert added the comment: Man, you guys are quick! Cheers! -- ___ Python tracker <http://bugs.python.org/issue11628> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1156179] Calls from VBScript clobber passed args
Chris Lambacher added the comment: copied to pywin32 bug tracker: http://sourceforge.net/tracker/index.php?func=detail&aid=3238774&group_id=78018&atid=551954 -- nosy: +lambacck ___ Python tracker <http://bugs.python.org/issue1156179> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com