[issue23292] Enum doc suggestion

2015-01-21 Thread Mark Summerfield
Mark Summerfield added the comment: Georg said to assign this to Ethan Furman but I don't seem to have that facility. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23292 ___

[issue23291] Documentation about Py_Finalize(): Freeing objects

2015-01-21 Thread Albert Zeyer
New submission from Albert Zeyer: The documentation about Py_Finalize() about freeing objects is not exactly clear. Esp., when I have called Py_INCREF somewhere, those objects will always have ob_refcnt 0 unless I call Py_DECREF somewhere, what about these objects? Will they be freed in

[issue23292] Enum doc suggestion

2015-01-21 Thread Mark Summerfield
New submission from Mark Summerfield: I think it would be worth documenting globals().update(MyEnumeration.__members__) in the Interesting Examples section of the enum docs. I suspect that most people will find that importing enums is annoying because they'll get import A

[issue23095] [Windows] asyncio: race condition when cancelling a _WaitHandleFuture

2015-01-21 Thread STINNER Victor
STINNER Victor added the comment: To wait for the exit of the subprocess, we use RegisterWaitForSingleObject(). To cancel this wait, we can use UnregisterWait() which returns immediatly. Problem: UnregisterWait() doesn't tell us if the wait was cancelled or not, the cancellation is

[issue17620] Python interactive console doesn't use sys.stdin for input

2015-01-21 Thread Drekin
Drekin added the comment: Unfortunately, I have little or no experience with Python C code and I even don't have a C compiler installed so I cannot experiment. I'll just put my ideas how to solve this here. • Add sys.__readlinehook__ attribute, which can be set to a function taking a prompt

[issue22885] Arbitrary code execution vulnerability due to unchecked eval() call in dumbdbm module

2015-01-21 Thread Claudiu Popa
Changes by Claudiu Popa pcmantic...@gmail.com: -- priority: normal - high stage: - patch review versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22885 ___

[issue23292] Enum doc suggestion

2015-01-21 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- assignee: docs@python - ethan.furman nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23292 ___

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Joshua Landau
Joshua Landau added the comment: I think I've fixed the memory leaks (plural). There were also a host of other problems with the _UNPACK opcodes in ceval. Here are the things I remember fixing, although I think I did slightly more: - Not throwing an error when PyDict_New or PyDict_Update

[issue23166] urllib2 ignores opener configuration under certain circumstances

2015-01-21 Thread Enrico Tröger
Enrico Tröger added the comment: I got the same error suddenly with Python 2.7.9. I think this is quite unfortunate because it somewhat breaks existing behaviour, especially that SSL certificate verification is enabled by default. Don't get me wrong, this is the right thing in general and it

[issue22885] Arbitrary code execution vulnerability due to unchecked eval() call in dumbdbm module

2015-01-21 Thread Guido van Rossum
Guido van Rossum added the comment: Python 3's exception chaining allows us to do the second (easier to catch without resorting to except Exception: or even except:) while still showing the original exception in the traceback. -- nosy: +gvanrossum

[issue22885] Arbitrary code execution vulnerability due to unchecked eval() call in dumbdbm module

2015-01-21 Thread Claudiu Popa
Claudiu Popa added the comment: Here's a patch which uses ast.literal_eval instead. This doesn't get code executed, since literal_eval will fail loudly for anything other than a literal. There are some issues to consider: - let the current ast.literal_eval call bubble out with a lot of

[issue23294] A typo in the tutorial

2015-01-21 Thread aruseni
New submission from aruseni: https://docs.python.org/3/tutorial/controlflow.html In many ways the object returned by range() behaves as if it is a list, but in fact it isn’t. -- messages: 234449 nosy: aruseni priority: normal severity: normal status: open title: A typo in the

[issue23095] [Windows] asyncio: race condition when cancelling a _WaitHandleFuture

2015-01-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset fb8a093db8b1 by Victor Stinner in branch '3.4': Issue #23095, asyncio: Rewrite _WaitHandleFuture.cancel() https://hg.python.org/cpython/rev/fb8a093db8b1 -- nosy: +python-dev ___ Python tracker

[issue23095] [Windows] asyncio: race condition when cancelling a _WaitHandleFuture

2015-01-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset d3804307cce4 by Victor Stinner in branch '3.4': Issue #23095, asyncio: IocpProactor.close() must not cancel pending https://hg.python.org/cpython/rev/d3804307cce4 -- ___ Python tracker

[issue23293] [Windows] asyncio: race condition related to IocpProactor.connect_pipe()

2015-01-21 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- title: [Windows] asyncio: race condition related in IocpProactor.connect_pipe() - [Windows] asyncio: race condition related to IocpProactor.connect_pipe() ___ Python tracker

[issue23095] [Windows] asyncio: race condition when cancelling a _WaitHandleFuture

2015-01-21 Thread STINNER Victor
STINNER Victor added the comment: It took me several months to understand this issue. For the beginning of the story, see: https://code.google.com/p/tulip/issues/detail?id=196 But I think that *this* issue can be closed: UnregisterWaitEx() really do what we need in asyncio. I don't like the

[issue23293] [Windows] asyncio: race condition related in IocpProactor.connect_pipe()

2015-01-21 Thread STINNER Victor
New submission from STINNER Victor: Currently, IocpProactor.connect_pipe() is implemented with QueueUserWorkItem() which starts a thread that cannot be interrupted. Because of that, this function requires special cases in _register() and close() methods of IocpProactor. While fixing the

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Joshua Landau
Joshua Landau added the comment: The _UNPACK opcodes are new in this changelist. Yup, but they're used in the other unpacking syntax too: (*(1, 2, 3), *(4, 5, 6)) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2292

[issue23095] [Windows] asyncio: race condition when cancelling a _WaitHandleFuture

2015-01-21 Thread Guido van Rossum
Guido van Rossum added the comment: Congrats with the fix, and thanks for your perseverance! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23095 ___

[issue23295] [Windows] asyncio: add UDP support to ProactorEventLoop

2015-01-21 Thread STINNER Victor
New submission from STINNER Victor: ProactorEventLoop lacks UDP support: create_datagram_endpoint() is not supported. New functions should be added to the _overlapped modul. Example: add maybe WSARecvFrom()? -- components: Windows, asyncio messages: 234456 nosy: gvanrossum, haypo,

[issue22885] Arbitrary code execution vulnerability due to unchecked eval() call in dumbdbm module

2015-01-21 Thread Claudiu Popa
Claudiu Popa added the comment: Thanks for the tip, Guido. The new patch uses exception chaining. If this needs backporting, most probably the first patch can be used. -- Added file: http://bugs.python.org/file37813/issue22885_1.patch ___ Python

[issue23294] A typo in the tutorial

2015-01-21 Thread aruseni
Changes by aruseni aruseni.mag...@gmail.com: -- assignee: - docs@python components: +Documentation nosy: +docs@python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23294 ___

[issue23095] [Windows] asyncio: race condition when cancelling a _WaitHandleFuture

2015-01-21 Thread STINNER Victor
STINNER Victor added the comment: IocpProactor.close() must not cancel pending _WaitCancelFuture futures FYI I found this bug when running the trollius test suite. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23095

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Neil Girdhar
Neil Girdhar added the comment: Very nice! So what's left besides errors? * Fixing the grammar, ast, and compilation for the list, dict, and set comprehension element unpackings Now the primary problem is giving good errors; I don't know how to make them look like they came from the

[issue23297] ‘tokenize.detect_encoding’ is confused between text and bytes: no ‘startswith’ method on a byte string

2015-01-21 Thread R. David Murray
R. David Murray added the comment: bytes does support startswith: b'abc'.startswith(b'a') True -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23297 ___

[issue14910] argparse: disable abbreviation

2015-01-21 Thread Andy Zobro
Andy Zobro added the comment: This breaks custom actions. e.g.: class dict_action(argparse.Action): def __init__(self, *a, **k): argparse.Action.__init__(self, *a, **k) TypeError: __init__() got an unexpected keyword argument 'allow_abbrev' -- nosy: +xobes

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Neil Girdhar
Neil Girdhar added the comment: Also maybe not in this changelist, but we should consider replacing STORE_MAP and BUILD_MAP with a single opcode BUILD_MAP(n) that produces a dict out of the top n items on the stack just like BUILD_LIST(n) does. What do you think? --

[issue17776] IDLE Internationalization

2015-01-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: I answered my Q1 in msg187219: test.test_gettest is currently passing, with no skips, on 2.7 and 3.4 on Win 7. patch.diff: I would rather add the 4 lines of the proposed idle_i18n.py to an existing module, perhaps Bindings.py itself, since that is the first

[issue23298] Add ArgumentParser.add_mutually_dependence_group

2015-01-21 Thread dongwm
New submission from dongwm: Sometimes I need to use argparse like this: parser = argparse.ArgumentParser(prog='PROG') group = parser.add_mutually_dependence_group() group.add_argument('--foo') group.add_argument('--bar') parser.parse_args(['--foo', 'f', '--bar', 'b']) Namespace(bar='b',

[issue23298] Add ArgumentParser.add_mutually_dependence_group

2015-01-21 Thread dongwm
Changes by dongwm ciici...@gmail.com: Added file: http://bugs.python.org/file37816/argparse_test.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23298 ___

[issue14910] argparse: disable abbreviation

2015-01-21 Thread Andy Zobro
Andy Zobro added the comment: Ignore previous comment, I wish I could delete it. I simply provided the allow_abbrev to the wrong function and spent zero time investigating the error. -- ___ Python tracker rep...@bugs.python.org

[issue23296] ‘tokenize.detect_encoding’ is confused between text and bytes: no ‘startswith’ method on a byte string

2015-01-21 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- resolution: - duplicate status: open - closed superseder: - ‘tokenize.detect_encoding’ is confused between text and bytes: no ‘startswith’ method on a byte string ___ Python tracker

[issue23298] Add ArgumentParser.add_mutually_dependence_group

2015-01-21 Thread dongwm
Changes by dongwm ciici...@gmail.com: Added file: http://bugs.python.org/file37815/argparse_doc.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23298 ___

[issue23294] A typo in the tutorial

2015-01-21 Thread Eric V. Smith
Eric V. Smith added the comment: What's the typo? I'm not seeing it. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23294 ___

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Joshua Landau
Joshua Landau added the comment: According to the standard, int can be only 16 bits long so that only leaves 255/255. However, if the offset is on top of the dictionary count, this is easily enough to clear the limits for the maximum function size (worst case is a merge of 255 dicts with an

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Neil Girdhar
Neil Girdhar added the comment: You're right. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2292 ___ ___ Python-bugs-list mailing list

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Neil Girdhar
Neil Girdhar added the comment: I am a huge fan of giving good errors. Looks good to me. Will we need to make sure that the call helper function we worked on produces additional BUILD_MAP_UNPACK opcodes every 256 dictionaries just in case? -- ___

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Neil Girdhar
Neil Girdhar added the comment: Another option to consider is to just use a bit on the BUILD_MAP_UNPACK and then have a stack marking opcode at the function call (not sure what to call it, but say FUNCTION_CALL_MARK) The advantage would be you don't store or calculate relative stack

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Joshua Landau
Joshua Landau added the comment: Functions are already limited to 255 arguments, so I don't think so. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2292 ___

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Neil Girdhar
Neil Girdhar added the comment: Oh, I see. For BUILD_MAP_UNPACK we don't want to raise on duplicate dict comprehension element unpackings, right? Maybe we should add a different opcode, or else a flag to the opcodes, or else use the top bit of the length parameter? What do you think?

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Neil Girdhar
Neil Girdhar added the comment: I see your point: if there are 255 dictionaries, there's no room for neither preceding keyword arguments nor positional arguments. Okay, then I like your solution. -- ___ Python tracker rep...@bugs.python.org

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Joshua Landau
Joshua Landau added the comment: We wouldn't want to replace STORE_MAP since that's used in dictionary comprehensions, but replacing BUILD_MAP with BUILD_MAP(n) sounds like a great idea. -- ___ Python tracker rep...@bugs.python.org

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Joshua Landau
Joshua Landau added the comment: Good catch. CALL_FUNCTION seems to split its opcode into two to give it a positional-keyword pair so this seems fine. I'd hope we can do the same thing; personally I would do: BUILD_MAP_UNPACK( position_of_function_in_stack_or_0 8 |

[issue23297] ‘tokenize.detect_encoding’ is confused between text and bytes: no ‘startswith’ method on a byte string

2015-01-21 Thread Ben Finney
New submission from Ben Finney: In `tokenize.detect_encoding` is the following code:: first = read_or_stop() if first.startswith(BOM_UTF8): # … The `read_or_stop` function is defined as:: def read_or_stop(): try: return readline() except

[issue23296] ‘tokenize.detect_encoding’ is confused between text and bytes: no ‘startswith’ method on a byte string

2015-01-21 Thread Ben Finney
New submission from Ben Finney: In `tokenize.detect_encoding` is the following code:: first = read_or_stop() if first.startswith(BOM_UTF8): # … The `read_or_stop` function is defined as:: def read_or_stop(): try: return readline() except

[issue23297] ‘tokenize.detect_encoding’ is confused between text and bytes: no ‘startswith’ method on a byte string

2015-01-21 Thread Ben Finney
Ben Finney added the comment: Possibly related to issue9969. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23297 ___ ___ Python-bugs-list

[issue23154] MSVC 2013 Express needlessly rebuilds code

2015-01-21 Thread Mark Lawrence
Mark Lawrence added the comment: I've noticed a similar problem this morning with 5 modules rebuilt under Debug but 29 under Release. I believe the change that triggered me spotting it is this fb8a093db8b1 Issue #23095. Do we need a new issue for this? --

[issue23288] subprocess.Popen close_fds behaviour differs between 3.2 and 3.4

2015-01-21 Thread Mike Sampson
New submission from Mike Sampson: I'm seeing differing behaviour with subprocess.Popen(..., close_fds = False) between 3.2 and 3.4. The docs don't say this is meant to be the case as far as I can see. Python 3.2.3 on Debian Wheezy = import subprocess import os

[issue23288] subprocess.Popen close_fds behaviour differs between 3.2 and 3.4

2015-01-21 Thread Mike Sampson
Mike Sampson added the comment: Ah, got it. Didn't see the note on the os.pipe() docs. Thanks. Closing. Sorry for the noise. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23288 ___

[issue23288] subprocess.Popen close_fds behaviour differs between 3.2 and 3.4

2015-01-21 Thread Mike Sampson
Changes by Mike Sampson m...@sambodata.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23288 ___ ___ Python-bugs-list

[issue22176] update internal libffi copy to 3.1, introducing AArch64 and POWER ELF ABIv2

2015-01-21 Thread koobs
Changes by koobs koobs.free...@gmail.com: -- nosy: +koobs ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22176 ___ ___ Python-bugs-list mailing

[issue23286] A typo in the tutorial

2015-01-21 Thread Mayank Tripathi
Changes by Mayank Tripathi oqua...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file37804/intro_typo.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23286 ___

[issue23285] PEP 475 - EINTR handling

2015-01-21 Thread Charles-François Natali
Charles-François Natali added the comment: The review diff is weird: it seems it contains changes that aren't EINTR-related (see e.g. argparse.rst). Here's a manually generated diff. -- Added file: http://bugs.python.org/file37802/eintr.diff ___

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Neil Girdhar
Neil Girdhar added the comment: Added many tests, six of which fail. Started work on grammar to fix new tests. -- Added file: http://bugs.python.org/file37805/starunpack11.diff ___ Python tracker rep...@bugs.python.org

[issue23288] subprocess.Popen close_fds behaviour differs between 3.2 and 3.4

2015-01-21 Thread STINNER Victor
STINNER Victor added the comment: File descriptors are not closed, but not inherited neither, in Python 3.4. See the PEP 446. To have a reliable behaviour on all platforms and all Python versions, just use the pass_fds parameter. -- nosy: +haypo

[issue23288] subprocess.Popen close_fds behaviour differs between 3.2 and 3.4

2015-01-21 Thread STINNER Victor
STINNER Victor added the comment: https://docs.python.org/dev/library/os.html#os.pipe Changed in version 3.4: The new file descriptors are now non-inheritable. If you don't use the subprocess module, you may use os.set_inheritable().

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

2015-01-21 Thread lilydjwg
Changes by lilydjwg lilyd...@gmail.com: -- nosy: +lilydjwg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5907 ___ ___ Python-bugs-list mailing

[issue11698] Improve repr for structseq objects to show named, but unindexed fields

2015-01-21 Thread lilydjwg
Changes by lilydjwg lilyd...@gmail.com: -- nosy: +lilydjwg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11698 ___ ___ Python-bugs-list mailing

[issue23193] Please support numeric_owner in tarfile

2015-01-21 Thread Michael Vogt
Michael Vogt added the comment: Thanks everyone for the comments and feedback! Attached is a updated patch with tests and a documentation update. Feedback is very welcome. I decided to skip the test on systems where root is not uid,gid=0. I could also mock that of course if you prefer it

[issue23289] concurrent.futures.Executor.map is not equivalent to map.

2015-01-21 Thread Piotr Majkrzak
New submission from Piotr Majkrzak: In documentation https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.Executor.map is writen that this fucntion is equivalent to the builtin map. But it is not true due to the fact that it is not lazy evalueded. The reason is in

[issue12029] Catching virtual subclasses in except clauses

2015-01-21 Thread Yuriy Taraday
Yuriy Taraday added the comment: Can we move forward and land this patch? It seems to be working and for some reason it even makes that microbenchmark work faster. -- versions: +Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org

[issue23290] Faster set copying

2015-01-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is even faster patch. When there are no dummies in source set we can just dump a table, placing entries at the same indices. $ ./python -m timeit -s s = set(range(10**4)) -- frozenset(s) Unpatched: 1000 loops, best of 3: 658 usec per loop Patched: 1000

[issue23288] subprocess.Popen close_fds behaviour differs between 3.2 and 3.4

2015-01-21 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- resolution: - not a bug stage: - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23288 ___

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Joshua Landau
Joshua Landau added the comment: Some of the tests seemed to be failing simply because they were incorrect. This fixes that. -- Added file: http://bugs.python.org/file37806/starunpack12.diff ___ Python tracker rep...@bugs.python.org

[issue23290] Faster set copying

2015-01-21 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch makes faster creating new set from other set. The benefit is only few percents when there are no hash conflicts, but can be significant if there are hash duplicates. $ ./python -m timeit -s s = set(range(10**4)) -- frozenset(s) Unpatched:

[issue12312] is ok

2015-01-21 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- Removed message: http://bugs.python.org/msg234435 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12312 ___

[issue12029] Catching virtual subclasses in except clauses

2015-01-21 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12029 ___ ___

[issue12312] is ok

2015-01-21 Thread liyang
liyang added the comment: -- name:李洋 celephone:15011548154 -- nosy: +liyang1...@gmail.com ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12312 ___

[issue23290] Faster set copying

2015-01-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +patch nosy: +pitrou, rhettinger Added file: http://bugs.python.org/file37807/set_faster_copy.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23290