[issue24526] Exponent function bug

2015-06-29 Thread bhaskar
Changes by bhaskar b.bhaskar.n...@gmail.com: Added file: http://bugs.python.org/file39830/pythonabc.png ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24526 ___

[issue24526] Exponent function bug

2015-06-29 Thread bhaskar
New submission from bhaskar: the value of a -ve number when raised by a power of even number always results in a +ve number. I tried it with -1**10 , -1**2, -9**4 these all are resulting in -ve numbers which is mathematically incorrect. ps. the same example is in the attachment --

[issue24514] tarfile fails to extract archive (handled fine by gnu tar and bsdtar)

2015-06-29 Thread Tal Einat
Tal Einat added the comment: The patch is very simple, but this needs tests. At the very least, a simple tar file which reproduces this issue could be added to the tests. Taking this a step further would be writing some unit tests for the internal nti() and itn() functions, and perhaps also

[issue24528] Misleading exeption for await in comprehensions.

2015-06-29 Thread Yury Selivanov
Changes by Yury Selivanov yseliva...@gmail.com: -- assignee: - yselivanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24528 ___ ___

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-06-29 Thread Ryan Gonzalez
Ryan Gonzalez added the comment: You compiled with -fPIE and GCC, right? I know the Android Clang seems broken. On June 29, 2015 7:09:25 AM CDT, Cyd Haselton rep...@bugs.python.org wrote: Cyd Haselton added the comment: FYI, Figured out that running ./configure with --with-pydebug does NOT

[issue24420] Documentation regressions from adding subprocess.run()

2015-06-29 Thread Martin Panter
Martin Panter added the comment: New patch dropping the [, input] parameter from the signature. I also removed the bit about *stdout*, since it should be obvious from the equivalent run() call given, and equally applies to *check*. -- Added file:

[issue24514] tarfile fails to extract archive (handled fine by gnu tar and bsdtar)

2015-06-29 Thread Lars Gustäbel
Lars Gustäbel added the comment: I think a simple addition to the existing unittest for nti() will be enough. itn() seems well-tested, and nts() and stn() are not affected, because they don't operate on numbers. -- Added file: http://bugs.python.org/file39832/issue24514.diff

[issue24483] Avoid repeated hash calculation in C implementation of functools.lru_cache()

2015-06-29 Thread Tal Einat
Tal Einat added the comment: With clru_cache_known_hash_4.patch on the current default branch, the entire test suite passes here (OSX 10.10). -- nosy: +taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24483

[issue5945] PyMapping_Check returns 1 for lists

2015-06-29 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi levkivs...@gmail.com: -- nosy: +levkivskyi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5945 ___ ___ Python-bugs-list

[issue24527] The MimeTypes class cannot ignore global files per instance

2015-06-29 Thread Sebastian Noack
New submission from Sebastian Noack: In order to prevent the mimetypes module from considering global files and registry entries, you have to call mimetypes.init([]). However, this will enforce that behavior globally, and only works if the module wasn't initialized yet. There is also a

[issue24528] Misleading exeption for await in comprehensions.

2015-06-29 Thread Ivan Levkivskyi
New submission from Ivan Levkivskyi: The following code: async def foo(): lst = [await coro(i) for i in range(10)] return lst gives SyntaxError: 'await' outside async function I understand that this is because the comprehensions are implemented using a function scope (see also

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-06-29 Thread Cyd Haselton
Cyd Haselton added the comment: FYI, Figured out that running ./configure with --with-pydebug does NOT define Py_DEBUG in pyconfig.h. Defining it in pyconfig.h got me past the undefined reference to `_PyUnicode_CheckConsistency' error, but i'm now getting this: if test $? -ne 0 ; then \

[issue19217] Calling assertEquals for moderately long list takes too long

2015-06-29 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi levkivs...@gmail.com: -- nosy: +levkivskyi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19217 ___ ___ Python-bugs-list

[issue21253] unittest assertSequenceEqual can lead to Difflib.compare() crashing on mostly different sequences

2015-06-29 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi levkivs...@gmail.com: -- nosy: +levkivskyi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21253 ___ ___ Python-bugs-list

[issue21827] textwrap.dedent() fails when largest common whitespace is a substring of smallest leading whitespace

2015-06-29 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi levkivs...@gmail.com: -- nosy: +levkivskyi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21827 ___ ___ Python-bugs-list

[issue24527] The MimeTypes class cannot ignore global files per instance

2015-06-29 Thread Wladimir Palant
Changes by Wladimir Palant t...@adblockplus.org: -- nosy: +Wladimir Palant ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24527 ___ ___

[issue24272] PEP 484 docs

2015-06-29 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi levkivs...@gmail.com: -- nosy: +levkivskyi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24272 ___ ___ Python-bugs-list

[issue11352] Update cgi module doc

2015-06-29 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi levkivs...@gmail.com: -- nosy: +levkivskyi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11352 ___ ___ Python-bugs-list

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-06-29 Thread Cyd Haselton
Cyd Haselton added the comment: No...haven't upgraded to Android 5.0 yet. On June 29, 2015 9:00:01 AM CDT, Ryan Gonzalez rep...@bugs.python.org wrote: Ryan Gonzalez added the comment: You compiled with -fPIE and GCC, right? I know the Android Clang seems broken. On June 29, 2015 7:09:25 AM

[issue17546] Document the circumstances where the locals() dict get updated

2015-06-29 Thread Martin Panter
Martin Panter added the comment: I quickly scanned through the email thread from Issue 17960. I guess it makes sense to specify that locals() can be used to directly get a class’s namespace. Probably doesn’t hurt to say locals() is equivalent to globals() at module level, although this seems

[issue24530] `import..as` fails where `import` does not

2015-06-29 Thread Dustin J. Mitchell
New submission from Dustin J. Mitchell: Reproduction: # main.py import foo.bar # foo/__init__.py # (empty) # foo/bar/__init__.py import foo.bar.bing as bing # foo/bar/bing.py # (empty) Result: dustin@euclid ~/tmp $ python3.3 main.py Traceback (most recent call last): File main.py, line

[issue19176] DeprecationWarning for doctype() method when subclassing _elementtree.XMLParser

2015-06-29 Thread Martin Panter
Martin Panter added the comment: inherit-doctype.v3.patch looks good to me -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19176 ___ ___

[issue24531] please document that no code preceding encoding declaration is allowed

2015-06-29 Thread Jakub Wilk
New submission from Jakub Wilk: If the encoding is declared on the second line, the first line must not contain anything except comments. However, this fact is not documented. The Python Language reference says only that the encoding declaration must appear on a line of its own; and PEP 263

[issue24518] json.dumps should accept key function for ``sort_keys``

2015-06-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: The idea and patch look reasonable. Bob, what do you think? -- assignee: - bob.ippolito nosy: +bob.ippolito, rhettinger versions: +Python 3.6 -Python 3.4 ___ Python tracker rep...@bugs.python.org

[issue22609] Constructors of some mapping classes don't accept `self` keyword argument

2015-06-29 Thread Martin Panter
Martin Panter added the comment: Patch looks fine to me. I understand Yury withdrew his comment. -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22609

[issue24529] Same MemoryError object gets thrown from different places.

2015-06-29 Thread SylvainDe
New submission from SylvainDe: Disclaimer: This is very minor, impacts only Python 2 and is maybe not even a bug. Context: I was randomly changing attribute of Exception objects when I discovered something I did not expect : sometimes when an exception occurs, a new object is raised (which

[issue3353] make built-in tokenizer available via Python C API

2015-06-29 Thread Dustin J. Mitchell
Dustin J. Mitchell added the comment: This seems to have stalled out after the PyCon sprints. Any chance the final patch can be reviewed? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3353

[issue24530] `import..as` fails where `import` does not

2015-06-29 Thread R. David Murray
R. David Murray added the comment: I'm pretty sure this has already been reported, but I have no idea how to search for the issue :) If I remember correctly there's a doc patch, so I suppose it hasn't been applied. But I could be misremembering. -- nosy: +brett.cannon, eric.snow,

[issue24529] Same MemoryError object gets thrown from different places.

2015-06-29 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24529 ___ ___ Python-bugs-list

[issue24528] Misleading exeption for await in comprehensions.

2015-06-29 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks for discovering this, Ivan. The patch is attached. -- keywords: +needs review, patch nosy: +ncoghlan stage: - patch review Added file: http://bugs.python.org/file39834/awaitcomp.patch ___ Python tracker

[issue24518] json.dumps should accept key function for ``sort_keys``

2015-06-29 Thread Bob Ippolito
Bob Ippolito added the comment: Seems like a good idea to me, I'll make sure this gets in simplejson as well. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24518 ___

[issue24529] Same MemoryError object gets thrown from different places.

2015-06-29 Thread R. David Murray
R. David Murray added the comment: If the same memory exception object were not used, we'd have to allocate memory for the new one... -- nosy: +r.david.murray resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker

[issue24531] please document that no code preceding encoding declaration is allowed

2015-06-29 Thread R. David Murray
R. David Murray added the comment: What docs are you looking at? https://docs.python.org/3/reference/lexical_analysis.html#encoding-declarations? I suspect the author thought that If a comment in the first or second line... implied both lines needed to be comments, but I agree that the

[issue24532] asyncio.sock_recv() blocks normal ioloop actions.

2015-06-29 Thread Марк Коренберг
New submission from Марк Коренберг: Suppose that program: import asyncio import socket def receiver(loop): (a, b) = socket.socketpair() loop.call_later(1, lambda: print('Should be called inside the loop')) end = loop.time() + 3

[issue24526] Exponent function bug

2015-06-29 Thread R. David Murray
R. David Murray added the comment: This bit of python's precedence rules often catches people by surprise. ** binds tighter than -, so what python is evaluating is -(1**10). -- nosy: +r.david.murray resolution: - not a bug stage: - resolved status: open - closed type: compile error

[issue24532] asyncio.sock_recv() blocks normal ioloop actions.

2015-06-29 Thread STINNER Victor
STINNER Victor added the comment: You should develop using asyncio debug mode: https://docs.python.org/dev/library/asyncio-dev.html#asyncio-dev haypo@selma$ PYTHONASYNCIODEBUG=1 ./python x.py Starting busy receiver Traceback (most recent call last): File x.py, line 21, in module main()

[issue24467] bytearray pop and remove Buffer Over-read

2015-06-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- components: +Interpreter Core resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24467

[issue24518] json.dumps should accept key function for ``sort_keys``

2015-06-29 Thread Bob Ippolito
Bob Ippolito added the comment: On further investigation, simplejson has implemented this functionality under a different name since 2.5.0 (2012-03-29). If item_sort_key is a callable (not the default), then the output of dictionaries will be sorted with it. The callable will be used like

[issue24467] bytearray pop and remove Buffer Over-read

2015-06-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset a887ce8611d2 by Serhiy Storchaka in branch '2.7': Issue #24467: Fixed possible buffer over-read in bytearray. The bytearray https://hg.python.org/cpython/rev/a887ce8611d2 New changeset c95d7ffa492e by Serhiy Storchaka in branch '3.4': Issue #24467:

[issue24462] bytearray.find Buffer Over-read

2015-06-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The patch for issue24467 also fixed this issue in different way. In any case thank you Dmitry for your patches. -- components: +Interpreter Core resolution: - duplicate stage: patch review - resolved status: open - closed superseder: - bytearray

[issue24533] Increased Test Coverage for Lib/random.py

2015-06-29 Thread Charles Nodell
New submission from Charles Nodell: This patch just extends test coverage on the random library by a few lines. -- components: Tests files: mywork.patch keywords: patch messages: 245956 nosy: Charles Nodell priority: normal severity: normal status: open title: Increased Test Coverage

[issue24475] The docs never define what a pool task is

2015-06-29 Thread Daniel Neuberger
Daniel Neuberger added the comment: I second this. I was definitely confused at first and it took me a little while of googling to realize that jobs are not what one (at least me) would intuitively think they are. -- nosy: +Daniel Neuberger ___

[issue24534] disable executing code in .pth files

2015-06-29 Thread STINNER Victor
STINNER Victor added the comment: The attached patch removes support for executing code in .pth files This change will basically break all Python applications. Don't do that. If you believe that we can smoothly move to a world without .pth files, you should propose an overall plan, step by

[issue24533] Increased Test Coverage for Lib/random.py

2015-06-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +mark.dickinson, rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24533 ___ ___

[issue3530] ast.NodeTransformer doc bug

2015-06-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am reopening this as a doc bug because RewriteName is a copy (with 'ast.' prefixes added) of a buggy example in the doc. The bug is that the new .value Name and Str attributes do not get the required 'lineno' and 'col_offset' attributes. As Armin said,

[issue24531] please document that no code preceding encoding declaration is allowed

2015-06-29 Thread Jakub Wilk
Jakub Wilk added the comment: Right, I meant https://docs.python.org/3/reference/lexical_analysis.html#encoding-declarations. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24531 ___

[issue24534] disable executing code in .pth files

2015-06-29 Thread R. David Murray
R. David Murray added the comment: I'm guessing this feature has been around too long and is used in too many ways to remove. I believe it is effectively disabled by -I (if it is not, that would be a valid feature request). However, since setuptools was the pioneer in this area, if

[issue19176] DeprecationWarning for doctype() method when subclassing _elementtree.XMLParser

2015-06-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 75571407dcd3 by Serhiy Storchaka in branch '3.4': Issue #19176: Fixed doctype() related bugs in C implementation of ElementTree. https://hg.python.org/cpython/rev/75571407dcd3 New changeset 6ae8842e9b60 by Serhiy Storchaka in branch '3.5': Issue

[issue24534] disable executing code in .pth files

2015-06-29 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +brett.cannon, eric.snow, ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24534 ___ ___

[issue24530] `import..as` fails where `import` does not

2015-06-29 Thread Martin Panter
Martin Panter added the comment: Maybe Issue 23203, proposing to fix the compiled bytecode. -- nosy: +vadmium resolution: - duplicate stage: - resolved status: open - closed superseder: - Aliasing import of sub-{module,package} from the package raises AttributeError on import.

[issue24400] Awaitable ABC incompatible with functools.singledispatch

2015-06-29 Thread Stefan Behnel
Stefan Behnel added the comment: isawaitable(), however, should continue using abc.Awaitable, since it only checks for __await__ presence on the type (or should we just drop it?) I'd really remove it. It's not referring to an actual type, so it doesn't fit the purpose of the inspect module.

[issue19176] DeprecationWarning for doctype() method when subclassing _elementtree.XMLParser

2015-06-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In 2.7 XMLParser is a function, not a class, and therefore can't be subclassed. -- resolution: - fixed stage: commit review - resolved status: open - closed versions: -Python 2.7 ___ Python tracker

[issue24534] disable executing code in .pth files

2015-06-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 29.06.2015 21:30, Min RK wrote: .pth files currently allow execution of arbitrary code, triggered by lines starting with `import`. This is a rarely understood, and often misbehaving feature. easy_install has used this feature to ensure that its

[issue14046] argparse: assertion failure if optional argument has square/round brackets in metavar

2015-06-29 Thread John Jones
John Jones added the comment: Im kind of surprised this bug has lasted for so many years :) setting part_regexp to: r'\(.*?\(.*?\).*?\)+|\[.*?\[.*?\].*?\]+|\S+' fixes the issue for me, although its not very elegant -- nosy: +John Jones ___ Python

[issue24530] `import..as` fails where `import` does not

2015-06-29 Thread R. David Murray
R. David Murray added the comment: Ah, yes, that is the issue I was thinking of. So, bug, not doc issue :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24530 ___

[issue24534] disable executing code in .pth files

2015-06-29 Thread Tim Smith
Tim Smith added the comment: In Homebrew we occasionally use .pth files to call site.addsitedir. This is useful when we want to add a directory to sys.path that contains .pth files that also need to be processed (for example, when adding a directory to sys.path that contains namespace

[issue24525] [doc] missing word

2015-06-29 Thread Vincent Legoll
New submission from Vincent Legoll: Here is a patch to fix a missing word in the urllib doc -- assignee: docs@python components: Documentation files: python-doc-fix.hgpatch messages: 245927 nosy: docs@python, vincent-legoll priority: normal severity: normal status: open title: [doc]

[issue24279] Update test_base64 to use test.support.script_helper

2015-06-29 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24279 ___ ___ Python-bugs-list

[issue17546] Document the circumstances where the locals() dict get updated

2015-06-29 Thread Martin Panter
Martin Panter added the comment: Here is another attempt with different words: ''' .. note:: The dictionary returned by :func:`locals` is an accurate snapshot of the local namespace at the time it is called. If the namespace changes after the call, the dictionary may become out of date,

[issue17546] Document the circumstances where the locals() dict get updated

2015-06-29 Thread Nick Coghlan
Nick Coghlan added the comment: I mostly like Martin's suggested wording, but would also note that I filed issue 17960 to tighten up the requirements for when we expect assigning to locals() to work. To save folks reading the whole referenced email, I think it would be worth defining that

[issue18576] Document test.support.script_helper

2015-06-29 Thread Martin Panter
Martin Panter added the comment: I left some more comments on Reitveld. The main one is I think stderr gets stripped with assert_python_ok(), but I don’t think stdout is touched. Correct me if I’m wrong though. -- ___ Python tracker

[issue24134] assertRaises can behave differently

2015-06-29 Thread Robert Collins
Robert Collins added the comment: Hi, catching up (see my mail to -dev about not getting tracker mail). Deprecations++. Being nice for folk whom consume unittest2 which I backport to everything is important to me :). -- ___ Python tracker

[issue24532] asyncio.sock_recv() blocks normal ioloop actions.

2015-06-29 Thread Марк Коренберг
Марк Коренберг added the comment: $ PYTHONASYNCIODEBUG=1 ./bug.py Starting busy receiver Busy receiver complete Executing Task pending coro=receiver() running at ./bug.py:16 wait_for=Future pending cb=[Task._wakeup()] created at /usr/lib/python3.4/asyncio/tasks.py:490

[issue24532] asyncio.sock_recv() blocks normal ioloop actions.

2015-06-29 Thread Марк Коренберг
Марк Коренберг added the comment: Adding of b.setblocking(0) after socketpair() does not help. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24532 ___

[issue24535] SELinux reporting writes, executes, and dac_overwrites

2015-06-29 Thread Ned Deily
Ned Deily added the comment: This is not a Python problem; note in particular the blueman references in the messages. A quick web searching suggests there is a conflict between blueman and SELinux security policies that need to be resolved; see, for example,

[issue24533] Increased Test Coverage for Lib/random.py

2015-06-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't mind adding a test but would like it to written somewhat differently. I'll work something up when I get a chance. Marking this as a low priority because the code is already working fine and this is just a nice addition to improve coverage.

[issue24535] SELinux reporting writes, executes, and dac_overwrites

2015-06-29 Thread Nick Levinson
New submission from Nick Levinson: Suddenly, SELinux in my Fedora 20 Linux laptop is reporting many problems with /usr/bin/python2.7 and I don't know if there's a bug in python2.7 or if something else is going on. File/s or directory/ies on which writes were attempted were on unspecified

[issue24532] asyncio.sock_recv() blocks normal ioloop actions.

2015-06-29 Thread Yury Selivanov
Yury Selivanov added the comment: You should develop using asyncio debug mode: Maybe we should promote this check to the production mode? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24532

[issue24534] disable executing code in .pth files

2015-06-29 Thread Min RK
New submission from Min RK: .pth files currently allow execution of arbitrary code, triggered by lines starting with `import`. This is a rarely understood, and often misbehaving feature. easy_install has used this feature to ensure that its packages are highest priority (even higher than