[issue29821] importing module shutil executes file 'copy.py'

2017-03-15 Thread Ammar Askar
Ammar Askar added the comment: I was only able to recreate this under 3.4 and 3.3, and both of them are under "security" status on https://docs.python.org/devguide/#status-of-python-branches Should this be marked as won't fix? -- nosy: +ammar2 versions: +Python 3.3, Python 3

[issue29326] Blank lines in ._pth file are not ignored

2017-02-07 Thread Ammar Askar
Changes by Ammar Askar <am...@ammaraskar.com>: -- status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29326> ___ _

[issue29028] Use-After-Free in PyString_FromStringAndSize() of stringobject.c

2017-02-05 Thread Ammar Askar
Ammar Askar added the comment: Did you forget to close this or is this not fixed, Serhiy? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29400] Instruction level tracing via sys.settrace

2017-01-31 Thread Ammar Askar
Ammar Askar added the comment: A git style patch can be found at https://github.com/gwk/cpython/commit/071d17cedfdf2db8b405aab5adabebe2ac5ef67b.patch -- nosy: +ammar2 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29329] Incorrect documentation for custom `hex()` support on Python 2

2017-01-31 Thread Ammar Askar
Ammar Askar added the comment: Attached patch changes the py2.7 documentation to point out that the method name is __hex__ and its return type is a string. -- keywords: +patch nosy: +ammar2 Added file: http://bugs.python.org/file46466/hex_method.diff

[issue29389] math.isclose signature contains incorrect start parameter

2017-01-30 Thread Ammar Askar
Changes by Ammar Askar <am...@ammaraskar.com>: -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue29362] regrtest: don't fail immediately if a child does crash

2017-01-28 Thread Ammar Askar
Ammar Askar added the comment: This patch makes it so that when a child runner crashes during a multiprocess test run, it is treated similar to a keyboard interrupt. That is, the currently running tests will continue to run and immediately after it will print out a summary. I think the test

[issue29326] Blank lines in ._pth file are not ignored

2017-01-20 Thread Ammar Askar
Ammar Askar added the comment: I've attached a patch that makes the site package ignore empty lines in .pth files. Along with a test for this behavior. I'm not really familiar with the site machinery so I hope the test and code are fine. -- keywords: +patch nosy: +ammar2 Added file

[issue29281] json.loads documentation missing "versionchanged" statement

2017-01-20 Thread Ammar Askar
Ammar Askar added the comment: Which part is misleading, do you think the use of "encoding" could be confused with the argument encoding? There is a note right above the versionchanged block that says: `The other arguments have the same meaning as in load(), except encoding which

[issue29281] json.loads documentation missing "versionchanged" statement

2017-01-19 Thread Ammar Askar
Ammar Askar added the comment: Attached patch adds a versionchanged block to specify that bytes and bytesarray can now be used and the types of encodings it supports (as taken from the whatsnew changes here https://hg.python.org/cpython/rev/e9e1bf9ec2ac#l2.7) -- keywords: +patch Added

[issue29292] Missing a parameter in PyEval_EvalCodeEx doc

2017-01-19 Thread Ammar Askar
Ammar Askar added the comment: Updated patch to include a cross reference to keyword-only arguments since I think not everyone will know about this rather new feature. -- Added file: http://bugs.python.org/file46349/kwdefs_docs.diff4 ___ Python

[issue29292] Missing a parameter in PyEval_EvalCodeEx doc

2017-01-19 Thread Ammar Askar
Ammar Askar added the comment: Updated patch for review comments -- Added file: http://bugs.python.org/file46348/kwdefs_docs.diff3 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29281] json.loads documentation missing "versionchanged" statement

2017-01-18 Thread Ammar Askar
Ammar Askar added the comment: To anyone more experienced with python documentation, is behavior like this actually supposed to be documented? For some more historical context, the support for bytes in the json module was removed in this issue: https://bugs.python.org/issue4136 and then re

[issue29292] Missing a parameter in PyEval_EvalCodeEx doc

2017-01-18 Thread Ammar Askar
Changes by Ammar Askar <am...@ammaraskar.com>: Added file: http://bugs.python.org/file46332/kwdefs_docs.diff2 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29292] Missing a parameter in PyEval_EvalCodeEx doc

2017-01-18 Thread Ammar Askar
Ammar Askar added the comment: You're completely right, the kwdefs is referring to default arguments for keyword-only-arguments from this PEP: https://www.python.org/dev/peps/pep-3102/ Where as that line is probably referring to "defs", the defaults for normal parameters. I

[issue29292] Missing a parameter in PyEval_EvalCodeEx doc

2017-01-17 Thread Ammar Askar
Ammar Askar added the comment: It looks like a basic description of kwdefs was added as part of this commit: https://github.com/python/cpython/commit/7811a5d1c93f2aa0b357444eeb3f1ddc242ac57a "keywords and defaults," however, the kwdefs argument was never added to the prototype. I'v

[issue29254] Documentation Error

2017-01-12 Thread Ammar Askar
Ammar Askar added the comment: Given `slice[start:end]`: What this line is trying to say is that the slice index is inclusive for the start parameter and exclusive for the end parameter. In mathematical/interval notation this would look like [start, end) As a quick example look at the word

[issue29226] Comment generates syntax error

2017-01-10 Thread Ammar Askar
Ammar Askar added the comment: Thanks for the link Jim, looks like my googling skills are a bit amiss. I believe the reason the matching allows "encoding" is because a recommended format in the documentation is: # vim:fileencoding= I think changing the behavior of the matching to b

[issue29226] Comment generates syntax error

2017-01-10 Thread Ammar Askar
Ammar Askar added the comment: This is because the "coding:" in a comment is a special syntax used to define the encoding of the file. The only documentation I could find for it on the official docs is a brief mention here: https://docs.python.org/3/howto/unicode.html#the-string-

[issue29122] set() bug

2016-12-31 Thread Ammar Askar
Ammar Askar added the comment: Why would the expected output be [1, 2, 3]? That is the list notation for having a list that contains the elements 1, 2 and 3. -- nosy: +ammar2 ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue29097] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6

2016-12-30 Thread Ammar Askar
Changes by Ammar Askar <am...@ammaraskar.com>: Added file: http://bugs.python.org/file46092/truncate_negatives.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29097] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6

2016-12-30 Thread Ammar Askar
Ammar Askar added the comment: I've attached two patches that fix this behavior, one by simply foregoing the fold detection for this time range on windows (the patch that I'd argue is simpler and more readable) And one that truncates the passed values to local to not be negative. This one

[issue29028] Use-After-Free in PyString_FromStringAndSize() of stringobject.c

2016-12-29 Thread Ammar Askar
Ammar Askar added the comment: Updated patch based on Rietveld review -- Added file: http://bugs.python.org/file46083/buffer-use-after-free-fix.patch2 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29106] get-pip.py fails with Python 3.6 embed Windows

2016-12-29 Thread Ammar Askar
Ammar Askar added the comment: Please post this issue on pypa's get-pip issue tracker https://github.com/pypa/get-pip -- nosy: +ammar2 resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <rep...@bug

[issue29097] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6

2016-12-29 Thread Ammar Askar
Ammar Askar added the comment: I just ran the following script to check if there are any folds from timestamps [0, 86399] in any timezone. import datetime import pytz for tz in pytz.all_timezones: tz = pytz.timezone(tz) for i in range(86400

[issue29097] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6

2016-12-29 Thread Ammar Askar
Ammar Askar added the comment: The 86,399 upperbound comes from this line (max_fold_seconds=86400): https://github.com/python/cpython/blob/master/Modules/_datetimemodule.c#L4277-L4278 The bug is introduced as part of the fold detection in this commit: https://github.com/python/cpython/commit

[issue29097] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6

2016-12-29 Thread Ammar Askar
Ammar Askar added the comment: Can recreate successfully on windows, but not on linux: > C:\Python36\python.exe -c "import datetime; > datetime.datetime.fromtimestamp(42)" Traceback (most recent call last): File "", line 1, in OSError: [Errno 22] Invalid argument

[issue29085] Python 3.6 on Windows doesn't seed Random() well enough

2016-12-27 Thread Ammar Askar
Ammar Askar added the comment: Can recreate under Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32 and on latest master. -- nosy: +ammar2 versions: +Python 3.7 ___ Python tracker <

[issue29071] IDLE doesn't highlight f-strings properly

2016-12-26 Thread Ammar Askar
Ammar Askar added the comment: Not a problem, thank you for the encouragement. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29071] IDLE doesn't highlight f-strings properly

2016-12-26 Thread Ammar Askar
Ammar Askar added the comment: I've attached a patch that colorizes f-strings. The issue is marked as "test needed" which the dev guide says "... reporter should post a script or instructions to let a triager or developer reproduce the issue." Steps to re-create are to

[issue29028] Use-After-Free in PyString_FromStringAndSize() of stringobject.c

2016-12-26 Thread Ammar Askar
Changes by Ammar Askar <am...@ammaraskar.com>: -- nosy: +benjamin.peterson ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29028> ___

[issue29028] Use-After-Free in PyString_FromStringAndSize() of stringobject.c

2016-12-26 Thread Ammar Askar
Ammar Askar added the comment: The proposed patch fixes this, not sure if a regression test is appropriate here. Here's a more minimal example that demonstrates the exact problem: ``` class Index(): def __index__(self): global a a.append("2")

[issue29050] xml.etree.ElementTree in Python 3.6 is incompatible with defusedxml

2016-12-22 Thread Ammar Askar
Ammar Askar added the comment: >From what I can tell from the failed travis run in defused, the problem is >here: https://github.com/tiran/defusedxml/blob/master/defusedxml/common.py#L129-L141 It's caused by it using the removed _IterParseIterator file (or rather a field that repr

[issue26267] UUID docs should say how to get "standard form"

2016-12-08 Thread Ammar Askar
Ammar Askar added the comment: I've updated the patch to document the comparison operators in prose instead of with markup as requested. -- Added file: http://bugs.python.org/file45807/uuiddocs.diff5 ___ Python tracker <rep...@bugs.python.org>

[issue19489] move quick search box above TOC

2016-09-09 Thread Ammar Askar
Ammar Askar added the comment: >The latter. All of the popular browsers (Chrome, Firefox, Edge and even >Safari) already support the placeholder attribute so I think we can safely >ignore IE 8 :) Roger, I've changed it to placeholder. >I know this is basically a copy

[issue27947] Trailing backslash in raw string format causes EOL

2016-09-02 Thread Ammar Askar
Ammar Askar added the comment: This isn't a bug, in fact this very behavior is documented within the string docs, please read the last paragraph here: https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals -- nosy: +ammar2 title: Bug of python interpreter

[issue19489] move quick search box above TOC

2016-08-09 Thread Ammar Askar
Ammar Askar added the comment: > 1. It would be better to make "Quick search" a placeholder Do you mean in addition to the "Quick search" text that is already on the page or do you want to remove that? Because placeholder isn't fully compatible with some older brow

[issue27697] Obscure bug in the int() function

2016-08-05 Thread Ammar Askar
Ammar Askar added the comment: You've ran into a classic floating point number limitation. Please read the following doc page: https://docs.python.org/2/tutorial/floatingpoint.html The problem comes when you multiply the number by 100, which is what causes the precision loss and drops

[issue27695] Compilation doesnt' end

2016-08-05 Thread Ammar Askar
Ammar Askar added the comment: Just in case anyone is wondering why this happens. The compiler's peephole optimizer will fold constant expressions like x = 5 + 5 into x = 10 More specifically, this bit here: https://github.com/python/cpython/blob/0f21fe6155227d11dc02bd3ef3b061de4ecea445

[issue19489] move quick search box above TOC

2016-08-03 Thread Ammar Askar
Ammar Askar added the comment: Amended the navigation bar patch to add back a change that only shows the searchbar if javascript is enabled. -- Added file: http://bugs.python.org/file43995/searchbar_in_header.diff2 ___ Python tracker <

[issue19489] move quick search box above TOC

2016-08-03 Thread Ammar Askar
Ammar Askar added the comment: This patch adds the search bar to the navigation/header area on the right. -- Added file: http://bugs.python.org/file43994/searchbar_in_header.diff ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue26267] UUID docs should say how to get "standard form"

2016-08-03 Thread Ammar Askar
Ammar Askar added the comment: Done. As a side question, are changes like those indentation problems tracked somewhere else/merged in bulk like spelling changes? -- Added file: http://bugs.python.org/file43988/uuiddocs.diff4 ___ Python tracker <

[issue26267] UUID docs should say how to get "standard form"

2016-08-02 Thread Ammar Askar
Ammar Askar added the comment: Whoops, didn't export the patch properly there so it didn't get picked up by the review tool, this should fix it. -- Added file: http://bugs.python.org/file43980/uuiddocs.diff3 ___ Python tracker <

[issue26267] UUID docs should say how to get "standard form"

2016-08-02 Thread Ammar Askar
Ammar Askar added the comment: Fixed the str() representation as per Evelyn's comment. -- Added file: http://bugs.python.org/file43979/uuiddocs.diff2 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27631] .exe is appended to python executable based on filesystem case insensitivity

2016-07-27 Thread Ammar Askar
Ammar Askar added the comment: Aah, you're completely correct. Renaming it to python and doing ./python causes it to confuse it with the directory. Sorry. -- resolution: -> not a bug status: open -> closed ___ Python tracker <rep...@bugs.p

[issue27631] .exe is appended to python executable based on filesystem case insensitivity

2016-07-27 Thread Ammar Askar
New submission from Ammar Askar: I encountered some odd behavior today, I compiled python inside VirtualBox, however, I compiled it inside a shared folder. The OS outside of VirtualBox is Windows, so the shared folder naturally is case-insensitive. The actual virtual OS is Debian Linux. Upon

[issue19489] move quick search box above TOC

2016-07-23 Thread Ammar Askar
Ammar Askar added the comment: Thank you for pointing that out to me, it completely slipped past. It looks like the 'Report a Bug' link disappears because deprecated api is used in Doc/tools/templates/layout.html {% block sidebarsourcelink %} {% endblock %} http://www.sphinx-doc.org/en

[issue19489] move quick search box above TOC

2016-07-19 Thread Ammar Askar
Ammar Askar added the comment: bump, added the documentation experts list, not sure if the core dev who made this issue is still active. -- nosy: +eric.araujo ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27538] Segfault on error in code object checking

2016-07-17 Thread Ammar Askar
Ammar Askar added the comment: Can recreate on both py2.7 and py3.6 Constructor for CodeType in py3.6 is slightly different: exec(code(0, 0, 2, 3, 0, b"lol lolol", (), (), (), "", "", 0, b"")) -- nosy: +ammar2 versions: +Python 3.6 __

[issue27514] SystemError when compiling deeply nested for loops

2016-07-14 Thread Ammar Askar
Ammar Askar added the comment: Amended patch with the comment fixed to refer to just the issue numbers according to advice from bitdancer. -- Added file: http://bugs.python.org/file43726/nested_blocks.diff2 ___ Python tracker <rep...@bugs.python.

[issue27514] SystemError when compiling deeply nested for loops

2016-07-14 Thread Ammar Askar
Ammar Askar added the comment: This patch changes it to a SyntaxError instead of a SystemError. -- keywords: +patch nosy: +ammar2 Added file: http://bugs.python.org/file43725/nested_blocks.diff ___ Python tracker <rep...@bugs.python.org>

[issue23710] C API doc for PyObject_HEAD is outdated

2016-07-07 Thread Ammar Askar
Ammar Askar added the comment: >The current text is what we want as far as that goes. Roger that, I've reverted the change to make that a warning in the newest diff. -- Added file: http://bugs.python.org/file43657/capidocs.diff-2 ___ Python trac

[issue27400] Datetime NoneType after calling Py_Finalize and Py_Initialize

2016-07-06 Thread Ammar Askar
Ammar Askar added the comment: Is there any particular reason that datetime.strptime caches the imported module like that? >From a quick search, these two other examples don't bother with any caching: https://github.com/python/cpython/blob/2d264235f6e066611b412f7c2e1603866e0f7f1b/Modu

[issue19489] move quick search box above TOC

2016-07-06 Thread Ammar Askar
Ammar Askar added the comment: It looks like this can be fixed by us. Since sphinx 1.0 there is this handy config parameter: http://www.sphinx-doc.org/en/stable/config.html#confval-html_sidebars I've attached a patch which pins the searchbox as the first thing on every page

[issue23710] C API doc for PyObject_HEAD is outdated

2016-07-06 Thread Ammar Askar
Ammar Askar added the comment: This diff amends the documentation to point out that PyObject_HEAD includes the ob_base field, gives a brief overview of it and points to the PyObject/structures page for more information. It also changes the semicolon part to a warning for clarity

[issue26267] UUID docs should say how to get "standard form"

2016-07-06 Thread Ammar Askar
Ammar Askar added the comment: This patch adds documentation for the str(uuid) operator along with documenting the fact that UUID instances support comparisons with `>` and `<`. It also indents the attributes and descriptions to emphasize that they are part of the UUID instance, not th

[issue27458] Allow subtypes of unicode/str to hit the optimized unicode_concatenate block

2016-07-06 Thread Ammar Askar
Ammar Askar added the comment: > We really don't want to encourage any reliance on this optimization. It was > put there only to help mitigate the performance impact of a common mistake. Aah, I didn't realize the extra context behind why the unicode_concatenate path actually exists in

[issue27458] Allow subtypes of unicode/str to hit the optimized unicode_concatenate block

2016-07-05 Thread Ammar Askar
Ammar Askar added the comment: Thank you very much for the prompt feedback. I didn't even realize there was a __radd__ method, great catch. I've fixed this and added an appropriate test. Very good point about the interning. Seeing as its an implementation detail, I've changed the interned

[issue27458] Allow subtypes of unicode/str to hit the optimized unicode_concatenate block

2016-07-05 Thread Ammar Askar
Changes by Ammar Askar <am...@ammaraskar.com>: Removed file: http://bugs.python.org/file43631/python.diff ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue27458] Allow subtypes of unicode/str to hit the optimized unicode_concatenate block

2016-07-05 Thread Ammar Askar
Ammar Askar added the comment: Side note, I was using this script which uses gdb to trace the execution path when it concatenates strings. -- Added file: http://bugs.python.org/file43632/test.py ___ Python tracker <rep...@bugs.python.org>

[issue27458] Allow subtypes of unicode/str to hit the optimized unicode_concatenate block

2016-07-05 Thread Ammar Askar
New submission from Ammar Askar: So currently as far as string concatenation goes. ceval has this nice little branch it can take if both operators are unicode types. However, since this check is an Exact check, it means that subtypes of unicode end up going through the slow code path through

<    1   2   3   4   5