[issue19092] ExitStack.__exit__ incorrectly suppresses exceptions in __exit__ callbacks of inner context managers

2013-09-25 Thread Nick Coghlan
Nick Coghlan added the comment: That would be very helpful! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19092] ExitStack.__exit__ incorrectly suppresses exceptions in __exit__ callbacks of inner context managers

2013-09-25 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: Nick, thanks for the review. Do you need me to write the patch for the test suite along with the original patch? -- ___ Python tracker ___ _

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

2013-09-25 Thread Akira Kitada
Akira Kitada added the comment: Do you have any plan to work on patch for 2.7? Apparently your patch is only for 3.x. -- ___ Python tracker ___

[issue19095] Document SSLSocket.getpeercert always returns None without do_handshake

2013-09-25 Thread Dariusz Suchojad
New submission from Dariusz Suchojad: Hello, I'd like to suggest adding a simple note to SSLSocket.getpeercert stating that it will always return None if do_handshake has never been called. This is not the default behaviour, by default SSLSocket.__init__'s do_handshake_on_connect is True so .

[issue19087] bytearray front-slicing not optimized

2013-09-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Could you please provide an example which uses this feature? A generic example is to parse messages out of a TCP stream. Basically any protocol transported on TCP needs such a facility, or has to find workarounds (which are either suboptimal or complicated).

[issue19087] bytearray front-slicing not optimized

2013-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please provide an example which uses this feature? -- ___ Python tracker ___ ___ Python-

[issue19077] More robust TemporaryDirectory cleanup

2013-09-25 Thread Nick Coghlan
Nick Coghlan added the comment: Sounds good to me! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue2382] [Py3k] SyntaxError cursor shifted if multibyte character is in line.

2013-09-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file27506/adjust_offset-3.3.patch ___ Python tracker ___ ___ Python-bugs-lis

[issue19092] ExitStack.__exit__ incorrectly suppresses exceptions in __exit__ callbacks of inner context managers

2013-09-25 Thread Nick Coghlan
Nick Coghlan added the comment: Yep, as indicated by the patch, looks like just a bug with the location of the raise in the stack emulation. The contextlib tests will also need a new test case to cover this, as well as one to cover such an exception being suppressed by an outer manager. -

[issue19088] TypeError with pickle in embedded python3.3 when starting multiple Interpreters.

2013-09-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: > one copyreg for multiple interpreters... this looks wrong: each interpreter > has its own list of modules, but copyreg.__globals__ belongs to only one... > A good solution would be to cache the copyreg module in the > PyInterpreterState (it already has codec_

[issue2382] [Py3k] SyntaxError cursor shifted if multibyte character is in line.

2013-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added tests. I think it will be worth apply this patch which fixes the issue for most Europeans and than continue working on the issue of wide characters. -- Added file: http://bugs.python.org/file31874/adjust_offset_2.patch _

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-25 Thread Jason R. Coombs
New submission from Jason R. Coombs: >>> import urllib.parse >>> urllib.parse.urljoin('foo', []) 'foo' That should raise a TypeError, not succeed quietly as if an empty string were passed. -- components: Library (Lib) messages: 198418 nosy: jason.coombs priority: normal severity: norma

[issue19088] TypeError with pickle in embedded python3.3 when starting multiple Interpreters.

2013-09-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The NoneType that fails is in typeobject.c: _PyObject_CallMethodId(copyreg, &PyId__slotnames, "O", cls); The error here is that copyreg comes from a cached reference to the module, stored in a static variable (cached_copyreg_module). When the interpre

[issue18314] Have os.unlink remove junction points

2013-09-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am not sure if this is a bug or enhancement. It is a moot point until there is a patch to apply. A patch would need a test that fails now and passes with the patch. From the Wikipedia article, it appears that a test using mklink /J would not run on XP and w

[issue19087] bytearray front-slicing not optimized

2013-09-25 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue19087] bytearray front-slicing not optimized

2013-09-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch. Benchmarks (under Linux where realloc is fast; the gap may be wider under Windows): $ ./python -m timeit "b=bytearray(10)" "while b: b[:1] = b''" -> before: 225 msec per loop -> after: 60.4 msec per loop $ ./python -m timeit "b=bytearray(1

[issue18314] Have os.unlink remove junction points

2013-09-25 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +brian.curtin, tim.golden ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11638] python setup.py sdist --formats tar* crashes if version is unicode

2013-09-25 Thread Doug Hellmann
Changes by Doug Hellmann : -- nosy: +doughellmann ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue19077] More robust TemporaryDirectory cleanup

2013-09-25 Thread Richard Oudkerk
Richard Oudkerk added the comment: An alternative would be to use weakref.finalize() which would guarantee that cleanup happens before any purging occurs. That would allow the use of shutil: class TemporaryDirectory(object): def __init__(self, suffix="", prefix=template, dir=None):

[issue19021] AttributeError in Popen.__del__

2013-09-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: > Before applying the patch which fixes Popen.__del__() I think your #12085 patch should be applied and that issue closed. It is not specifically about shutdown. Tweaking shutdown further would be a new issue. -- __

[issue19093] Spam

2013-09-25 Thread Berker Peksag
Changes by Berker Peksag : -- Removed message: http://bugs.python.org/msg198412 ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue19093] Spam

2013-09-25 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: -bjimnen resolution: -> invalid stage: -> committed/rejected status: open -> closed title: RE -> Spam ___ Python tracker ___ __

[issue19093] RE

2013-09-25 Thread Roman
New submission from Roman: complete my registration -- messages: 198412 nosy: bjimnen priority: normal severity: normal status: open title: RE ___ Python tracker ___

[issue19092] ExitStack.__exit__ incorrectly suppresses exceptions in __exit__ callbacks of inner context managers

2013-09-25 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue19092] ExitStack.__exit__ incorrectly suppresses exceptions in __exit__ callbacks of inner context managers

2013-09-25 Thread Eric Snow
Changes by Eric Snow : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.o

[issue19092] ExitStack.__exit__ incorrectly suppresses exceptions in __exit__ callbacks of inner context managers

2013-09-25 Thread Hrvoje Nikšić
New submission from Hrvoje Nikšić: While using contextlib.ExitStack in our project, we noticed that its __exit__ method of contextlib.ExitStack suppresses the exception raised in any contextmanager's __exit__ except the outermost one. Here is a test case to reproduce the problem: class Err:

[issue19091] ast.parse gives wrong position for some Names when non-ascii characters occur before

2013-09-25 Thread Aivar Annamaa
Aivar Annamaa added the comment: > ast [gives positions as] offsets of UTF-8 bytes Oops, I'm sorry, I realized only now that this is the explanation of this behaviour. So, after all it seems to be a feature (albeit very weird), not a bug. -- resolution: -> invalid __

[issue19091] ast.parse gives wrong position for some Names when non-ascii characters occur before

2013-09-25 Thread Aivar Annamaa
Aivar Annamaa added the comment: I should explain more -- the string containing the program is read in correctly, the trouble occurs during parse. -- ___ Python tracker ___

[issue19091] ast.parse gives wrong position for some Names when non-ascii characters occur before

2013-09-25 Thread Aivar Annamaa
Aivar Annamaa added the comment: Serhiy, it's similar in that it has to do with encodings, but I think it's caused by different bug. I suspect it has something to do with the fact that tokenizer gives positions as offsets of characters and ast as offsets of UTF-8 bytes. -- __

[issue19081] zipimport behaves badly when the zip file changes while the process is running

2013-09-25 Thread Gregory P. Smith
Changes by Gregory P. Smith : Added file: http://bugs.python.org/file31871/issue19081-gps03.patch ___ Python tracker ___ ___ Python-bugs-list

[issue19091] ast.parse gives wrong position for some Names when non-ascii characters occur before

2013-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This looks similar to issue2382 and issue10382. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue19091] ast.parse gives wrong position for some Names when non-ascii characters occur before

2013-09-25 Thread Aivar Annamaa
New submission from Aivar Annamaa: ast.parse gives col_offset=4 for Name x when given program "a + x" vs. col_offset=5 for x when Name a is replaced with a-umlaut (I can't write that character here, because it seems that the issue system doesn't handle non-ascii characters either). See the at

[issue19081] zipimport behaves badly when the zip file changes while the process is running

2013-09-25 Thread Gregory P. Smith
Changes by Gregory P. Smith : Added file: http://bugs.python.org/file31869/issue19081-gps02.patch ___ Python tracker ___ ___ Python-bugs-list

[issue19021] AttributeError in Popen.__del__

2013-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could we instead restore the builtins module to it's initial state before the purging stage? I believe all builtins are immutable and can't create reference loops. -- ___ Python tracker

[issue19089] Windows: Make Ctrl-D exit key combination cross-platform

2013-09-25 Thread Tim Golden
Tim Golden added the comment: I'm at best +0.25, but I don't have a problem with Ctrl-D exiting on Windows, as it doesn't do anything else! The thing is, though, that this is all handled within myreadline.c:my_fgets which is a call into the system fgets which errors out with Ctrl-Z but return

[issue19089] Windows: Make Ctrl-D exit key combination cross-platform

2013-09-25 Thread Brian Curtin
Brian Curtin added the comment: I'm unable to find the previous issue, but you asked for this in the past. Ctrl-Z and Ctrl-D simply have different meanings on the different platforms, outside of what Python does. We already can't make Ctrl-Z on Windows do what it does on Linux, and Ctrl-D is n

[issue19089] Windows: Make Ctrl-D exit key combination cross-platform

2013-09-25 Thread Eric V. Smith
Eric V. Smith added the comment: It's trying to be consistent on whatever platform it's on. I'd rather python.exe match all other text-based .exe's on Windows. We can't have it both ways. But I agree it's a hassle. Cross-platform is a problem that Cygwin is trying to solve, so I suggest you u

[issue19089] Windows: Make Ctrl-D exit key combination cross-platform

2013-09-25 Thread anatoly techtonik
Changes by anatoly techtonik : -- title: Windows: Broken Ctrl-D shortcut on Python 3 -> Windows: Make Ctrl-D exit key combination cross-platform versions: +Python 2.7 ___ Python tracker ___

[issue19089] Windows: Broken Ctrl-D shortcut on Python 3

2013-09-25 Thread anatoly techtonik
anatoly techtonik added the comment: It would be nice if Python supported some cross-platform standard for user interfaces. It is rather annoying to use Ctrl-Z for Python in local window and Ctrl-D for Python in remote console session (which is *nix of course). It becomes even more annoying, b

[issue19089] Windows: Broken Ctrl-D shortcut on Python 3

2013-09-25 Thread Eric V. Smith
Eric V. Smith added the comment: The Windows (and before it MS-DOS) EOF character is Ctrl-Z. Try that. Depending on the toolset you use, it might use Ctrl-D as EOF. Cygwin's python uses Ctrl-D. -- nosy: +eric.smith ___ Python tracker

[issue19089] Windows: Broken Ctrl-D shortcut on Python 3

2013-09-25 Thread anatoly techtonik
anatoly techtonik added the comment: Here is the output of "py -v". -- Added file: http://bugs.python.org/file31868/py_-v.stderr.txt ___ Python tracker ___ __

[issue19089] Windows: Broken Ctrl-D shortcut on Python 3

2013-09-25 Thread anatoly techtonik
anatoly techtonik added the comment: Well, it appears that installed IPython brought pyreadline, but I execute it in standard Python shell. I'd vote for this feature by default. Is that possible without readline? -- ___ Python tracker

[issue19089] Windows: Broken Ctrl-D shortcut on Python 3

2013-09-25 Thread Tim Golden
Tim Golden added the comment: It doesn't work on Python 2.x either as delivered. Usually means you have an external readline module installed. -- nosy: +tim.golden ___ Python tracker __

[issue19089] Windows: Broken Ctrl-D shortcut on Python 3

2013-09-25 Thread Ethan Furman
Ethan Furman added the comment: Ctrl-D has never work for me on Windows either. -- nosy: +ethan.furman ___ Python tracker ___ ___ Pyth

[issue19089] Windows: Broken Ctrl-D shortcut on Python 3

2013-09-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: It never worked for me. Are you using a custom shell or cygwin or something? -- nosy: +amaury.forgeotdarc ___ Python tracker ___ _

[issue19089] Windows: Broken Ctrl-D shortcut on Python 3

2013-09-25 Thread anatoly techtonik
New submission from anatoly techtonik: Ctrl-D shortcut works to terminate session in Python 2 on Windows, and doesn't work with Python 3. -- components: Windows messages: 198393 nosy: techtonik priority: normal severity: normal status: open title: Windows: Broken Ctrl-D shortcut on Pyth

[issue19021] AttributeError in Popen.__del__

2013-09-25 Thread Richard Oudkerk
Richard Oudkerk added the comment: The clearing of modules at shutdown has been substantially changed in 3.4. Now a best effort is made to let the module go away purely by gc. Those modules which survive get purged in random order. In 3.3 all modules were purged, but builtins was special cas

[issue19087] bytearray front-slicing not optimized

2013-09-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: > And the same is for a list. List and bytearray are wrong types for > front deleting. There is no bytedeque(). > I don't think we should increase the size of > bytearray, and complicate and slowdown it for such special purpose. I don't think it would really s

[issue19087] bytearray front-slicing not optimized

2013-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And the same is for a list. List and bytearray are wrong types for front deleting. I don't think we should increase the size of bytearray, and complicate and slowdown it for such special purpose. If you want to implement a fifo using bytearray more optimal,

[issue19021] AttributeError in Popen.__del__

2013-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm wondering too. While the code in Popen.__del__() is almost same, I can't reproduce the issue in 3.3. Perhaps it relates to some 3.4 changes? Import machinery, weak references, the shutdown process? Before applying the patch which fixes Popen.__del__() I

[issue16038] ftplib: unlimited readline() from connection

2013-09-25 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- versions: -Python 2.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue16038] ftplib: unlimited readline() from connection

2013-09-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8b19e7d0be45 by Barry Warsaw in branch '2.6': - Issue #16038: CVE-2013-1752: ftplib: Limit amount of data read by http://hg.python.org/cpython/rev/8b19e7d0be45 -- nosy: +python-dev ___ Python tracker

[issue5907] repr of time.struct_time type does not eval

2013-09-25 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2013-09-25 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors

2013-09-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 436b606ecfe8 by Ethan Furman in branch 'default': Close #19030: improvements to inspect and Enum. http://hg.python.org/cpython/rev/436b606ecfe8 -- nosy: +python-dev resolution: -> fixed stage: patch review -> committed/rejected status: open

[issue19088] TypeError with pickle in embedded python3.3 when starting multiple Interpreters.

2013-09-25 Thread Larry Pete
New submission from Larry Pete: Hexchat (fork of XChat IRC Client) switched with version 2.9.6 to Python 3.3 for their Python plugins. Hexchat loads plugins in a similar fashion like the attached C file (not entirely sure I used the C-API right though). For every plugin a new interpreter is st

[issue19087] bytearray front-slicing not optimized

2013-09-25 Thread Antoine Pitrou
New submission from Antoine Pitrou: If you delete a slice at the end of a bytearray, it is naturally optimized (thanks to the resizing strategy). However, if you delete a slice at the front of a bytearray, it is not: a memmove() gets done every time. $ ./python -m timeit "b=bytearray(1)" "

[issue19078] Allow reversed(memoryview), like memoryview

2013-09-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: No, you're right, it should probably return 4. -- ___ Python tracker ___ ___ Python-bugs-list mailin

[issue19078] Allow reversed(memoryview), like memoryview

2013-09-25 Thread Claudiu.Popa
Claudiu.Popa added the comment: So, in the following case, len shouldn't return 4, but the number of items? Also, is it ok to assume that the number of items is ((*shape)[0] * ... * (*shape)[ndims-1])? >>> x = np.array([[1, 2, 3], [4, 5, 6], [4,5,6], [4,4,4]], np.int32) >>> x.shape (4, 3) >>> x

[issue18596] enable usage of AddressSanitizer in CPython [PATCH]

2013-09-25 Thread halfie
halfie added the comment: I am attaching the latest tested patch against tip. -- Added file: http://bugs.python.org/file31866/ASAN-compat-35da5d848ffd-v3.patch ___ Python tracker ___

[issue19083] IDNA prefix should be case insensitive

2013-09-25 Thread Berker Peksag
Changes by Berker Peksag : -- versions: +Python 3.4 -Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19086] Make fsum usable incrementally.

2013-09-25 Thread Oscar Benjamin
New submission from Oscar Benjamin: I would like to be able use fsum incrementally however it is not currently possible. With sum() you can do: subtotal = sum(nums) subtotal = sum(othernums, subtotal) This wouldn't work for fsum() because the returned float is not the same as the state maint

[issue16038] ftplib: unlimited readline() from connection

2013-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please apply it yourself. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19058] test_sys.test_ioencoding_nonascii() fails with ASCII locale encoding

2013-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Indeed. Here is a patch. It uses same algorithm to obtain encodable non-ASCII string as for FS_NONASCII, but with locale encoding. It also adds new tests and simplifies existing tests. -- keywords: +patch stage: needs patch -> patch review Added fil

[issue19084] No way to use TLS-PSK from python ssl

2013-09-25 Thread Roger Light
Roger Light added the comment: This is not TLS-SRP, but TLS-PSK as described by RFC 4279[1] There is a very small amount of overlap - the "unknown_psk_identity" error defined by PSK is also used in SRP. [1] http://tools.ietf.org/html/rfc4279 -- ___

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

2013-09-25 Thread Manuel Pégourié-Gonnard
Changes by Manuel Pégourié-Gonnard : -- nosy: -mpg ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

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

2013-09-25 Thread Sunny
Sunny added the comment: I've updated my patch with the review changes and tests. tokenize.detect_encoding throws a TypeError if the file object passed to it is in text mode. However, i've realized catching this is not necessary as i now check for TextIOBase instead of just StringIO before. -

[issue13824] argparse.FileType opens a file and never closes it

2013-09-25 Thread paul j3
paul j3 added the comment: An alternative way to delay the file opening, is to return an instance that has a `filename` attribute, and has an `open` method. This can be compactly added to the `FileContext` that I defined in the previous patch. The `FileContext` provides the `_ostest` functio