[issue19054] Descriptors howto

2013-09-21 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: docs@python - rhettinger priority: normal - low ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19054 ___

[issue19054] Descriptors howto

2013-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: The indentation is not incorrect. What you're seeing is normal for the interactive prompt. Also, it is not incorrect to inherit from object in Python 3. There is some value in keeping the document the same between versions. -- resolution: -

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: Just as an example: consider that in a lot of use cases the programmer will want to discard parts of the tree that's parsed iteratively (similarly to the main use case of iterparse()), because the XML itself is too huge. It's a convenient streaming API, in

[issue1065986] Fix pydoc crashing on unicode strings

2013-09-21 Thread Akira Kitada
Akira Kitada added the comment: Updated the previous patch to test unicode strings in __{version,date,author,credits}__ don't crash. -- Added file: http://bugs.python.org/file31832/issue1065986-3.patch ___ Python tracker rep...@bugs.python.org

[issue13963] dev guide has no mention of mechanics of patch review

2013-09-21 Thread Akira Kitada
Changes by Akira Kitada akit...@gmail.com: -- nosy: +akitada ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13963 ___ ___ Python-bugs-list mailing

[issue19050] crash while writing to a closed file descriptor

2013-09-21 Thread Tim Golden
Tim Golden added the comment: I can confirm that 2.7.2 hard-crashes as described on Windows. I'm not sure if I have the wherewithal to build 2.7 on this laptop to see if it's fixed in tip. 3.3 simply raises an IOError. -- ___ Python tracker

[issue19050] crash while writing to a closed file descriptor

2013-09-21 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- priority: normal - high ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19050 ___ ___

[issue1185124] pydoc doesn't find all module doc strings

2013-09-21 Thread Akira Kitada
Changes by Akira Kitada akit...@gmail.com: -- nosy: +akitada ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1185124 ___ ___ Python-bugs-list

[issue19060] docs: note that subprocess doesn't replace os.exec*

2013-09-21 Thread anatoly techtonik
New submission from anatoly techtonik: I always thought that subprocess is replacing all other methods of executing external programs from Python and it is a preferred way. Perhaps I was not attentive that people isolate: os.system os.spawn* os.popen* and os.exec* While subprocess

[issue19060] docs: note that subprocess doesn't replace os.exec*

2013-09-21 Thread anatoly techtonik
anatoly techtonik added the comment: tag:easy (meaning, please mark it as easy for OpenHatch robots) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19060 ___

[issue19056] Windows 7, script exec not working without explicit cal of python.exe

2013-09-21 Thread Thierry Seunevel
Thierry Seunevel added the comment: Many thanks for your answers. printing the sys.path gave me this output (parsed with newlines) '', 'D:\\soft\\python\\lib', 'D:\\Thierry\\python\\d\\thierry\\python', mispelled 'C:\\Windows\\system32\\python27.zip', 'd:\\soft\\python\\DLLs',

[issue19054] Descriptors howto

2013-09-21 Thread Marco Buttu
Changes by Marco Buttu marco.bu...@gmail.com: Removed file: http://bugs.python.org/file31831/py3howto.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19054 ___

[issue19054] Descriptors howto

2013-09-21 Thread Marco Buttu
Changes by Marco Buttu marco.bu...@gmail.com: Removed file: http://bugs.python.org/file31830/py2howto.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19054 ___

[issue19054] Descriptors howto

2013-09-21 Thread Marco Buttu
Marco Buttu added the comment: I think the indentation is a problem, for several reasons. In all the examples in the documentation, the form by using the interactive shell is the following: class MyClass: ... pass otherwise: class MyClass: pass This one is awful:

[issue19054] Descriptors howto

2013-09-21 Thread Marco Buttu
Changes by Marco Buttu marco.bu...@gmail.com: -- resolution: invalid - works for me status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19054 ___

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: Eli, seeing our discussion so far, ISTM that the parser-target interface is at the very heart of our disagreement. For me, it's a good design that provides a clean separation of concerns between the parser that generates events, and the target (usually, but

[issue19056] Windows 7, script exec not working without explicit cal of python.exe

2013-09-21 Thread Eric V. Smith
Eric V. Smith added the comment: Glad to see it's working. -- resolution: fixed - invalid stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19056

[issue19061] Shelve documentation security warning is not visible

2013-09-21 Thread anatoly techtonik
New submission from anatoly techtonik: This is a follow up to issue #8855. Currently the security warning is completely invisible from Python 2 docs http://docs.python.org/2/library/shelve.html and is located under screen border on Python 3 docs. The proposal is to move warning out of the

[issue19061] Shelve documentation security warning is not visible

2013-09-21 Thread anatoly techtonik
anatoly techtonik added the comment: tag:easy -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19061 ___ ___ Python-bugs-list mailing list

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-21 Thread Nick Coghlan
Nick Coghlan added the comment: Actually, I think it's reasonable to define the custom target nominally abstracted by PullParser as always returning None from close(). As Eli notes, it's designed to let you discard events as you go, so remembering them internally to return from close() doesn't

[issue10042] functools.total_ordering fails to handle NotImplemented correctly

2013-09-21 Thread Nick Coghlan
Nick Coghlan added the comment: Raymond, do you still want to look at this one? Otherwise I'll finish it up and commit it before the next alpha (I'll check the example in the enum docs to see if it can be simplified, too). -- ___ Python tracker

[issue19054] Descriptors howto

2013-09-21 Thread Marco Buttu
Marco Buttu added the comment: By looking at the other examples in the howto, I saw there is the same problem in all the definitions in the prompt, and furthermore, we are using a different number of spaces to indent MyClass respect the rest of the classes defined in the prompt. There is

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: That means the patch could be simplified to just removing the root attribute without changing the result of calling close(). Absolutely. Returning the parse result from close() would still make it both more consistent and easier to use (also from within

[issue19054] Descriptors howto

2013-09-21 Thread Ezio Melotti
Ezio Melotti added the comment: In the latest patch there are 5-spaces indents in several places. -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19054 ___

[issue1065986] Fix pydoc crashing on unicode strings

2013-09-21 Thread Akira Kitada
Akira Kitada added the comment: Now we have a working fix for 2.7. Could someone please review the attached patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1065986 ___

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-21 Thread Eli Bendersky
Eli Bendersky added the comment: On Sat, Sep 21, 2013 at 5:52 AM, Nick Coghlan rep...@bugs.python.orgwrote: Nick Coghlan added the comment: Actually, I think it's reasonable to define the custom target nominally abstracted by PullParser as always returning None from close(). As Eli notes,

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: Unfortunately I don't have time to review refactoring patches now. In light of a larger refactoring planned in this part of the module in the future, I don't think it's very important to tweak things right now. You misunderstood. The proposal was to remove

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-21 Thread Nick Coghlan
Nick Coghlan added the comment: Right, the minimum change needed is to prefix it with an underscore, but if it isn't actually needed for anything, we may as well remove it entirely. -- ___ Python tracker rep...@bugs.python.org

[issue19054] Descriptors howto

2013-09-21 Thread Marco Buttu
Changes by Marco Buttu marco.bu...@gmail.com: Removed file: http://bugs.python.org/file31834/py3full.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19054 ___

[issue19054] Descriptors howto

2013-09-21 Thread Marco Buttu
Marco Buttu added the comment: You are right. Now it should be ok -- Added file: http://bugs.python.org/file31835/py3full.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19054 ___

[issue19001] test_gdb fails on Fedora buildbot

2013-09-21 Thread Stefan Krah
Stefan Krah added the comment: The regular build (with threads) on that machine has the same problem. Closing the issue is fine, but there does not seem to be an easy way to upgrade Fedora from 16 to 19. Perhaps we can skip the test so that the buildbot continues to be useful. --

[issue19054] Descriptors howto

2013-09-21 Thread Marco Buttu
Marco Buttu added the comment: By the way, it does not pass all the tests in Python 2.7: $ python2.7 -m doctest descriptor_modified.rst | tail -n 1 ***Test Failed*** 3 failures. If we want to be very rigorous, in order to pass the tests in Py2.7 too (kipping the rst aligned between py2 and

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-21 Thread Eli Bendersky
Eli Bendersky added the comment: On Sat, Sep 21, 2013 at 7:26 AM, Nick Coghlan rep...@bugs.python.orgwrote: Nick Coghlan added the comment: Right, the minimum change needed is to prefix it with an underscore, but if it isn't actually needed for anything, we may as well remove it entirely.

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: I still consider this refactoring gratuitious at this point. The API is well defined by the documentation. All the rest is implementation details. Famous last words. -- ___ Python tracker rep...@bugs.python.org

[issue19062] problems with pyshell to get userdir

2013-09-21 Thread patrick wai
New submission from patrick wai: #file idlelib/configHandler.py #code userDir = os.path.expanduser('~') #os windows 7 sp1 it doesnt get final userdir path. it doesnt work correctly for userdir . this cause python3.3 IDLE GUI can not be opened on my pc . as per the docment says as follows:

[issue19062] problems with pyshell to get userdir

2013-09-21 Thread patrick wai
patrick wai added the comment: i am working under non-administrator account . in fact os.path.expanduser('~') works well when as admin run . but just got a %userprofile% when as standard account . On Sat, Sep 21, 2013 at 11:39 PM, patrick wai rep...@bugs.python.orgwrote: New submission from

[issue19009] Enhance HTTPResponse.readline() performance

2013-09-21 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Ok, Here is a new patch. We now inherit from BufferedIOBase. We must implement read(amt) ourselves, since the base class does not do it. I was wrong about the final chunk, it is in fact 0\r\n. A final \r\n is then added to signal the end of the

[issue19054] Descriptors howto

2013-09-21 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19054 ___ ___

[issue14983] email.generator should always add newlines after closing boundaries

2013-09-21 Thread Stephen J. Turnbull
Stephen J. Turnbull added the comment: Seems this hasn't been resolved. I have to disagree with David's interpretation of RFC 2046. The definition of a boundary says that it is terminated with a CRLF. It also clarifies that the introducing CRLF is conceptually part of the boundary. Thus

[issue14983] email.generator should always add newlines after closing boundaries

2013-09-21 Thread Daniel Kahn Gillmor
Daniel Kahn Gillmor added the comment: I think the relevant specification for PGP/MIME-signed messages is RFC 3156: https://tools.ietf.org/html/rfc3156#page-5 in particular: Note: The accepted OpenPGP convention is for signed data to end with a CRLF sequence. Note that the CRLF

[issue14983] email.generator should always add newlines after closing boundaries

2013-09-21 Thread Stephen J. Turnbull
Stephen J. Turnbull added the comment: Following OpenPGP convention is clearly optional (or maybe a SHOULD, but the word elect makes it a pretty weak SHOULD). RFC 2046 is a MUST, it's not a matter of convention. The problem is that a parser that works forward in the message will swallow the

[issue14983] email.generator should always add newlines after closing boundaries

2013-09-21 Thread R. David Murray
R. David Murray added the comment: Well, there are two problems here, I think (it's been a while since I looked at this): we should indeed be adding a crlf between mime boundary lines. But also the clients should technically be handling it not being there, as well as the case of extra

[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-09-21 Thread Florian Apolloner
New submission from Florian Apolloner: Take the following example: from email.mime.nonmultipart import * from email.charset import * msg = MIMENonMultipart('text', 'plain') cs = Charset('utf-8') cs.body_encoding = None msg.set_payload('А Б В Г Д Е Ж Ѕ З И І К Л М Н О П.', cs)

[issue14983] email.generator should always add newlines after closing boundaries

2013-09-21 Thread R. David Murray
R. David Murray added the comment: Heh, rather than not conformant I should have said that the two RFCs are in conflict, in my opinion. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14983

[issue14983] email.generator should always add newlines after closing boundaries

2013-09-21 Thread R. David Murray
R. David Murray added the comment: Stephen: my post crossed yours. Yes, I agree with your logic, having re-read the spec (the trailing CR is clearly part of the boundary). But I still think the logic of the signing/validation is an invitation for running into problems like this. --

[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-09-21 Thread R. David Murray
R. David Murray added the comment: There is definitely a bug here, but 8bit would also be wrong, since you are calling as_string. It *should* be producing a 7bit CTE with a base64 encoded part in that case. -- components: +email nosy: +barry, r.david.murray versions: +Python 3.2,

[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-09-21 Thread Florian Apolloner
Florian Apolloner added the comment: Am I not explicitelly disabling base64 by setting body_encoding to None? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19063 ___

[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-09-21 Thread R. David Murray
R. David Murray added the comment: You are, but you are also calling as_string. Unicode can not handle 8bit data, therefore the email package must down-transform all data to 7bit when converting it to a string, just like a mail server trying to send to another mail server that can only

[issue19054] Descriptors howto

2013-09-21 Thread Marco Buttu
Marco Buttu added the comment: $ python -c import this | grep silently Errors should never pass silently -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19054 ___

[issue19064] can't run py3 benchmarks

2013-09-21 Thread Antoine Pitrou
New submission from Antoine Pitrou: After the latest changes I don't understand how I'm supposed to run translated Python 3 benchmarks: $ ./perf.py -fb mako_v2 ../opt/python ../x32opt/python Running mako_v2... INFO:root:Running ../x32opt/python ./performance/bm_mako_v2.py -n 50 Traceback

[issue12085] subprocess.Popen.__del__ raises AttributeError if __init__ was called with an invalid argument list

2013-09-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: A class attribute is still a special case fix to a generic problem, if indeed the message is a problem. If class attribute backup is to become a requirement of all delete methods, it needs to first be documented, after pydev discussion. To apply the class

[issue1065986] Fix pydoc crashing on unicode strings

2013-09-21 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1065986 ___ ___ Python-bugs-list

[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-09-21 Thread Florian Apolloner
Florian Apolloner added the comment: Using BytesGenerator I get: fp = BytesIO() g = BytesGenerator(fp) msg = MIMENonMultipart('text', 'plain') msg.set_payload('А Б В Г Д Е Ж Ѕ З И І К Л М Н О П.', cs) g.flatten(msg) Traceback (most recent call last): File stdin, line 1, in module File

[issue12085] subprocess.Popen.__del__ raises AttributeError if __init__ was called with an invalid argument list

2013-09-21 Thread R. David Murray
R. David Murray added the comment: __del__ methods are in general tricky because they are in the general case run asynchronously. Therefore any proposal to attach the message to another message is a non-starter. If a __del__ method depends on attributes set in the __init__, then the

[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-09-21 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19063 ___

[issue12085] subprocess.Popen.__del__ raises AttributeError if __init__ was called with an invalid argument list

2013-09-21 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12085 ___

[issue12085] subprocess.Popen.__del__ raises AttributeError if __init__ was called with an invalid argument list

2013-09-21 Thread Guido van Rossum
Guido van Rossum added the comment: FWIW, using class attributes to ensure __del__ does not hit AttributeError when __init__ failed is more idiomatic than using three-argument getattr(). The reason: in general it is possible that __del__ calls almost any other method on a class (e.g. for a

[issue12085] subprocess.Popen.__del__ raises AttributeError if __init__ was called with an invalid argument list

2013-09-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: The whole point of the special case ignoring of AttributeError in __delete__ methods is that AttributeErrors are *expected* in certain circumstances. You are completely misunderstanding this. There is no special case for AttributeError inside __del__,

[issue12085] subprocess.Popen.__del__ raises AttributeError if __init__ was called with an invalid argument list

2013-09-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: The message problem can arise during exit if __del__ depends an any attribute of any object. It is hard to imagine a __del__ method that does not. Any __del__ method, including that of Popen, could handle AttributeErrors by wrapping the whole body in try:

[issue12085] subprocess.Popen.__del__ raises AttributeError if __init__ was called with an invalid argument list

2013-09-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: Reading Antoine's message more carefully, and the cited doc line, the generic fix to prevent the warning would be try: __del__ body except Exception: pass The question is, do we only want to block the warning when someone calls Popen with the wrong number

[issue12085] subprocess.Popen.__del__ raises AttributeError if __init__ was called with an invalid argument list

2013-09-21 Thread R. David Murray
R. David Murray added the comment: No, that is not a good fix. It would mask other programming errors. There is a *reason* the error/traceback is printed when an error occurs. The fact that the Popen logic may be a bit complex is not an argument in favor of a fix that hides errors.

[issue12085] subprocess.Popen.__del__ raises AttributeError if __init__ was called with an invalid argument list

2013-09-21 Thread Oleg Oshmyan
Oleg Oshmyan added the comment: But what about the self.returncode data attribute? Should we also add a class 'returncode' attribute? If so, what should be its value? None? or object()? Or is it guaranteed that when _child_created is set true, returncode will be defined, so that a class

[issue19065] sqlite3 timestamp adapter chokes on timezones

2013-09-21 Thread Chris Adams
New submission from Chris Adams: If you use detect_types=sqlite3.PARSE_DECLTYPES with sqlite3 and insert a timezone-aware datetime instance, you will get a ValueError if you attempt to read it back out: File

[issue12085] subprocess.Popen.__del__ raises AttributeError if __init__ was called with an invalid argument list

2013-09-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: Right. If _internal_poll raises, it should not be masked as that would be a true bug. More research. 'self.returncode = None' comes before the only call to the appropriate posix/windows version of ._execute_child(), which is the only place where

[issue19065] sqlite3 timestamp adapter chokes on timezones

2013-09-21 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19065 ___ ___

[issue19024] Document asterisk (*), splat or star operator

2013-09-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: Index entries for * and ** were added in #12531 so that both are indexed as operators, in function definitions, in function calls, and in the tutorial. If any of these places need improvement, there should be specific suggestions. I do not think there should

[issue19034] More useful repr for Tcl_Obj

2013-09-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: This looks more useful to me; it might make tests easier. But I cannot be sure no one would object. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19034

[issue19034] More useful repr for Tcl_Obj

2013-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19034 ___ ___ Python-bugs-list mailing

[issue19024] Document asterisk (*), splat or star operator

2013-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Terry. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19024 ___ ___

[issue19021] AttributeError in Popen.__del__

2013-09-21 Thread Oleg Oshmyan
Oleg Oshmyan added the comment: Anothe possible solution is get rid from getattr and catch AttributeError instead. Surely this would suffer from the same issue? Why are the builtins getting deleted anyway? In fact, why is getattr getting deleted from the builtins module? The __builtins__

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-21 Thread Nick Coghlan
Nick Coghlan added the comment: An undocumented name without a leading underscore is always a bug, as it means introspection and the prose docs give conflicting definitions of the public API. Whether the fix is to remove the offending name entirely, add a leading underscore to mark it as

[issue19066] os.execv fails with spaced names on Windows

2013-09-21 Thread anatoly techtonik
New submission from anatoly techtonik: If file to be executed with os.execv on Windows is located in directory with spaces, Python fails. This doesn't fail on Linux. To test, run: testexecv.py spaced testexecv.py is attached. -- components: Library (Lib), Windows files:

[issue19050] crash while writing to a closed file descriptor

2013-09-21 Thread Tim Peters
Tim Peters added the comment: Here with 2.7.5 on Windows (Vista): C:\Python27python.exe Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. import io, sys fd = io.open(sys.stdout.fileno(), 'wb')