[issue31178] [EASY] subprocess: TypeError: can't concat str to bytes, in _execute_child()

2017-08-10 Thread Ammar Askar
Changes by Ammar Askar : -- pull_requests: +3103 ___ Python tracker <http://bugs.python.org/issue31178> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12887] Documenting all SO_* constants in socket module

2017-08-10 Thread Ammar Askar
Changes by Ammar Askar : -- pull_requests: +3108 ___ Python tracker <http://bugs.python.org/issue12887> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14345] Document socket.SOL_SOCKET

2017-08-10 Thread Ammar Askar
Changes by Ammar Askar : -- pull_requests: +3109 ___ Python tracker <http://bugs.python.org/issue14345> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1732367] Document the constants in the socket module

2017-08-10 Thread Ammar Askar
Ammar Askar added the comment: I've opened up a PR for this ticket's dependencies. There's some things I'm looking for feedback on there: https://github.com/python/cpython/pull/3072 -- ___ Python tracker <http://bugs.

[issue1732367] Document the constants in the socket module

2017-08-12 Thread Ammar Askar
Ammar Askar added the comment: That makes sense, listing availability for exceptions would certainly make everything more succinct. How do you propose we mention that certain options don't actually do anything on Windows. Currently I have a footnote in the table that links to the

[issue31362] "async" and "await" are not keyword

2017-09-05 Thread Ammar Askar
Ammar Askar added the comment: For what its worth, "async" and "await" are special keywords. They only act as keywords under certain situations by the tokenizer. You can read more about this here: https://www.python.org/dev/peps/pep-0492/#transition-plan As far as I am

[issue31178] [EASY] subprocess: TypeError: can't concat str to bytes, in _execute_child()

2017-09-05 Thread Ammar Askar
Ammar Askar added the comment: If it doesn't manage to make it by tomorrow afternoon, I can backport it manually. It doesn't look like its been able to do it yet. -- nosy: +ammar2 ___ Python tracker <http://bugs.python.o

[issue35439] New class instance not initializing variables of type list

2018-12-07 Thread Ammar Askar
Ammar Askar added the comment: This is expected behavior, take a look at this section in the tutorial on classes: https://docs.python.org/3/tutorial/classes.html#class-and-instance-variables Unlike say Java, member variables need to be initialized in the constructor. -- nosy

[issue35475] Docs do not show PyImport_AddModuleObject() returns a borrowed reference.

2018-12-13 Thread Ammar Askar
Ammar Askar added the comment: A good place to start might be to search for a function that says it returns a borrowed reference in the source tree. For example, "PyImport_AddModule" says it returns a borrowed reference. In the search you'll find the relevant file here: htt

[issue35562] Issue in sizeof() function

2018-12-22 Thread Ammar Askar
Ammar Askar added the comment: This has to do with C struct packing and alignment. You are likely on a 64-bit computer and thus your structs are aligned to 8 byte (64 bit) boundaries. https://docs.python.org/2/library/ctypes.html#structure-union-alignment-and-byte-order Create an equivalent

[issue35562] Issue in sizeof() function

2018-12-22 Thread Ammar Askar
Ammar Askar added the comment: Iterating over _fields_ and adding up the sizeof() for each type could be one solution. -- ___ Python tracker <https://bugs.python.org/issue35

[issue35634] kwargs regression when there are multiple entries with the same key

2019-01-02 Thread Ammar Askar
Ammar Askar added the comment: This change in difference is caused by https://github.com/python/cpython/commit/e036ef8fa29f27d57fe9f8cef8d931d4122d8223 The old code checked for duplicate arguments by essentially running `set().intersection(d)` and since `set().intersection(['a',

[issue34838] Improve arg clinic code generation for cases with type checking

2019-01-11 Thread Ammar Askar
Ammar Askar added the comment: Sounds good, I'll take a look at the changes and update the PR accordingly. -- ___ Python tracker <https://bugs.python.org/is

[issue34838] Improve arg clinic code generation for cases with type checking

2019-01-11 Thread Ammar Askar
Ammar Askar added the comment: Great job Serhiy, your work on argument clinic has encompassed the previous PR very well. I've updated it for the changes. -- ___ Python tracker <https://bugs.python.org/is

[issue35951] os.renames() creates directories if original name doesn't exist

2019-02-10 Thread Ammar Askar
Ammar Askar added the comment: It seems this behavior is somewhat documented: https://docs.python.org/3/library/os.html#os.renames >Works like rename(), except creation of any intermediate directories needed to >make the new pathname good is attempted first. >This function can fail

[issue35796] time.localtime returns error for negative values

2019-02-10 Thread Ammar Askar
Ammar Askar added the comment: Victor is correct, this is a limitation in Windows. As the documentation for time notes: >Although this module is always available, not all functions are available on >all platforms. Most of the functions defined in this module call platform C &g

[issue35951] os.renames() creates directories if original name doesn't exist

2019-02-10 Thread Ammar Askar
Ammar Askar added the comment: Aah, I interpreted the combination of the warning and the fact that it says "attempted first" to mean that any failures in the actual renaming will leave the new directory in place. That is, no cleanup is ever performed. A quick glance at the cod

[issue35928] socket makefile read-write discards received data

2019-02-10 Thread Ammar Askar
Ammar Askar added the comment: Recreatable on master as well, also Martin your suspicion seems correct, reverting https://github.com/python/cpython/commit/23db935bcf258657682e66464bf8512def8af830 fixes it. -- nosy: +ammar2, serhiy.storchaka stage: -> needs patch versions: +Pyt

[issue35980] Py3 BIF random.choices() is O(N**2) but I've written O(N) code for the same task

2019-02-12 Thread Ammar Askar
Ammar Askar added the comment: I can't speak to the complexity of the choices function but if you're proposing an alternative implementation for choices, it would be wise to show the benefits empirically. That is, benchmarks and an explanation of why your implementation would be b

[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, Pyt

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

2017-03-15 Thread Ammar Askar
Ammar Askar added the comment: As per discussion with haypo on irc, this is not a bug since essentially you've made a file which shadows the following stdlib module https://docs.python.org/3/library/copy.html When shutil goes to import the copy module, your copy module is given h

[issue29812] test for token.py, and consistency tests for tokenize.py

2017-03-15 Thread Ammar Askar
Changes by Ammar Askar : -- pull_requests: +558 ___ Python tracker <http://bugs.python.org/issue29812> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29812] test for token.py, and consistency tests for tokenize.py

2017-03-15 Thread Ammar Askar
Ammar Askar added the comment: This is my first real substantial testing change so I'd appreciate all feedback. The way I did the cross-check doesn't actually rely on any of the information from the test_keyword style regeneration test. I think this approach is a lot simpler

[issue36670] test suite broken due to cpu usage feature on win 10/ german

2019-04-19 Thread Ammar Askar
Ammar Askar added the comment: What does `typeperf "\System\Processor Queue Length" -si 1` actually return on your non-English system? Does it just return an error with the counter's name or is the umalet just in the first header line, i.e this one for me: "(PDH-CSV

[issue36670] test suite broken due to cpu usage feature on win 10/ german

2019-04-19 Thread Ammar Askar
Ammar Askar added the comment: Thank you, could you also share the output if you just give it the English name of the counter? -- ___ Python tracker <https://bugs.python.org/issue36

[issue32543] odd floor division behavior

2018-01-12 Thread Ammar Askar
Ammar Askar added the comment: Looks like floor division for floats call into the divmod function, which has the same behavior: >>> 0.9 .__divmod__(0.1) (8.0, 0.09998) -- nosy: +ammar2 ___ Python tracker <https://bug

[issue33522] Enable CI builds on Visual Studio Team Services

2018-05-18 Thread Ammar Askar
Ammar Askar added the comment: >core-workflow made a premature decision to turn off Travis and AppVeyor and >make VSTS blocking. It looks like AppVeyor and Travis are still running as of the latest PR: https://github.com/python/cpython/pull/6965 Annoyingly, I don't think there

[issue33631] [ValueError] _strptime.py can't handle 12-hr format strings using '0' instead of '12' for noon and midnight

2018-05-24 Thread Ammar Askar
Ammar Askar added the comment: 0 is excluded because it is not a valid hour in the 12 hour clock. 0:39pm is not a valid time on a 12 hour clock. After 11am you reach 12pm, then 1pm. See the table on the right here: https://en.wikipedia.org/wiki/12-hour_clock Your data source is encoding the

[issue33689] Blank lines in .pth file cause a duplicate sys.path entry

2018-05-30 Thread Ammar Askar
Ammar Askar added the comment: If this is actually an issue, and not just a documentation lapse I can create a pull request from my original patch. -- nosy: +ammar2 ___ Python tracker <https://bugs.python.org/issue33

[issue33766] Grammar Incongruence

2018-06-03 Thread Ammar Askar
Ammar Askar added the comment: https://docs.python.org/3.8/reference/lexical_analysis.html -- nosy: +ammar2 ___ Python tracker <https://bugs.python.org/issue33

[issue33766] Grammar Incongruence

2018-06-03 Thread Ammar Askar
Ammar Askar added the comment: Actually, echo implicitly puts a newline at the end. If you run with echo -n, this is the output: $ echo -n 'print("a");print("b")' | python3 -m tokenize 1,0-1,5:NAME 'print' 1,5-1,

[issue33766] Grammar Incongruence

2018-06-03 Thread Ammar Askar
Ammar Askar added the comment: Relevant bit of the parser that emits a fake newline at the end of the file if not present: https://github.com/python/cpython/blob/master/Parser/tokenizer.c#L1059-L1069 -- ___ Python tracker <ht

[issue33766] Grammar Incongruence

2018-06-03 Thread Ammar Askar
Change by Ammar Askar : -- keywords: +patch pull_requests: +7009 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33766> ___ ___ Py

[issue33766] Grammar Incongruence

2018-06-03 Thread Ammar Askar
Ammar Askar added the comment: Sorry, I was already working on the patch by the time you posted the comment. If we see above, it seems like the tokenize module doesn't correctly mirror the behavior of the C tokenizer. Do you want to try fixing that as a bug? That would involve making

[issue33856] Type "help" is not present on win32

2018-06-16 Thread Ammar Askar
Ammar Askar added the comment: Can't recreate from latest Python 3.6.5 downloaded off python.org > D:\Python365\python.exe Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits&q

[issue10531] write tilted text in turtle

2018-06-16 Thread Ammar Askar
Ammar Askar added the comment: I don't think backwards compatibility matters too much for the turtle package but the way its proposed in the initial report makes it so that text in previous versions would now be angled to the turtle's heading. To keep the previous behavior a k

[issue33872] doc Add list access time to list definition

2018-06-16 Thread Ammar Askar
Ammar Askar added the comment: I don't think this should be documented at all, not in the glossary, nor the stdtypes section. A quick search through of the glossary and stdtypes indicates that the glossary entry of list is the only place where a time complexity is documented. The pr

[issue33872] doc Add list access time to list definition

2018-06-16 Thread Ammar Askar
Ammar Askar added the comment: I'd say edit the PR and the bug tracker issue to reflect the change. Though you might want to wait for the opinion of a core dev or someone with more documentation experience than me. -- ___ Python tracker &

[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-06-19 Thread Ammar Askar
New submission from Ammar Askar : As was pointed out in https://bugs.python.org/issue33766 there is an edge case in the tokenizer whereby it will implicitly treat the end of input as a newline. The tokenize module in stdlib does not mirror the C code's behavior in this case. tokeni

[issue33921] Explain that '' can be used to bind to all interfaces for the AF_INET address family in the docs

2018-06-21 Thread Ammar Askar
Ammar Askar added the comment: It's kinda mentioned: "For IPv4 addresses, two special forms are accepted instead of a host address: the empty string represents INADDR_ANY" Though it could be more explicit on what means since binding to all interfaces is a common use case.

[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-06-24 Thread Ammar Askar
Change by Ammar Askar : -- keywords: +patch pull_requests: +7501 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33899> ___ ___ Py

[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-07-06 Thread Ammar Askar
Change by Ammar Askar : -- pull_requests: +7710 ___ Python tracker <https://bugs.python.org/issue33899> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-07-06 Thread Ammar Askar
Change by Ammar Askar : -- pull_requests: +7711 ___ Python tracker <https://bugs.python.org/issue33899> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-07-06 Thread Ammar Askar
Change by Ammar Askar : -- pull_requests: +7712 ___ Python tracker <https://bugs.python.org/issue33899> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33361] readline() + seek() on codecs.EncodedFile breaks next readline()

2018-07-13 Thread Ammar Askar
Change by Ammar Askar : -- keywords: +patch pull_requests: +7813 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33361> ___ ___ Py

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-14 Thread Ammar Askar
Ammar Askar added the comment: Annoyingly, it looks like Windows does not provide an API that gives an average value. There is a counter exposed called "System \ Processor Queue Length" which does what the equivalent of unix's load https://blogs.technet.microsoft.com/askper

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-14 Thread Ammar Askar
Ammar Askar added the comment: Taking a shot at this, should take a day or so. -- ___ Python tracker <https://bugs.python.org/issue34060> ___ ___ Python-bug

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-14 Thread Ammar Askar
Change by Ammar Askar : -- keywords: +patch pull_requests: +7821 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34060> ___ ___ Py

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-14 Thread Ammar Askar
Ammar Askar added the comment: Thanks a lot for that link Jeremy, it was really helpful. After reading up on it, my take is that winapi is the most appropriate place for this, it is a non public api that's used in the stdlib. I've used Windows APIs in a way that we don't n

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-14 Thread Ammar Askar
Ammar Askar added the comment: Opened up a PR with a proof of concept to get feedback on if this approach is reasonable. Giampaolo, on your psutil issue you specifically said, "(possibly without using WMI)" Is there any particular problem with

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-15 Thread Ammar Askar
Ammar Askar added the comment: Aah, yeah I don't think there's a good way of doing it purely from the windows API. There might be a way to enumerate through all the processes and see if they're queued up but I didn't look into it. In this case it should be fine, we j

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-15 Thread Ammar Askar
Ammar Askar added the comment: Is the function I used for the callback, RegisterWaitForSingleObject https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-registerwaitforsingleobject using the thread pooling system you're talking about underneath? The documentation see

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-15 Thread Ammar Askar
Ammar Askar added the comment: Roger, personally I don't think its worth it to complicate the code in order to use the thread pool API. Especially considering this is just a private API and the only consumer will be the test suite runner. Let's see what the core devs think when

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-16 Thread Ammar Askar
Ammar Askar added the comment: I don't think taking instantaneous values instead of averaging will work out too well. For reference I've attached a screenshot. It has sampled values at every second on an unloaded computer and then with running prime95 for cpu stress testing. The

[issue34088] [EASY] sndhdr.what() throws exceptions on unknown files

2018-07-16 Thread Ammar Askar
Ammar Askar added the comment: Hey Lysandros. Take a look at https://github.com/python/cpython/blob/master/Lib/wave.py#L126-L139 Notice how there's a Chunk made from the `file` argument but then another Chunk created using the previous chunk as a file. While it might seem

[issue34088] [EASY] sndhdr.what() throws exceptions on unknown files

2018-07-17 Thread Ammar Askar
Ammar Askar added the comment: Hey David, thanks for your contribution, I've added some feedback in context of the code on Github. -- ___ Python tracker <https://bugs.python.org/is

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-18 Thread Ammar Askar
Ammar Askar added the comment: > But then again, if it's solely for our tests, perhaps the best way to > approach this is to start a Python thread that periodically runs this command? This sounds like a very good solution to me, it avoids adding the complexity of the C code.

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-20 Thread Ammar Askar
Change by Ammar Askar : -- pull_requests: +7892 ___ Python tracker <https://bugs.python.org/issue34060> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5115] Extend subprocess.kill to be able to kill process groups

2018-07-20 Thread Ammar Askar
Change by Ammar Askar : -- pull_requests: +7893 ___ Python tracker <https://bugs.python.org/issue5115> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34060] regrtest: log "CPU usage" on Windows

2018-07-20 Thread Ammar Askar
Ammar Askar added the comment: > But then again, if it's solely for our tests, perhaps the best way to > approach this is to start a Python thread that periodically runs this command? I opened up https://github.com/python/cpython/pull/8357 with this strategy, in my opinion its

[issue34237] faq/design: PEP 572 adds assignment expressions

2018-07-27 Thread Ammar Askar
Ammar Askar added the comment: This should be done as part of the doc changes for the full PEP 572 implementation, no point in independently doing it now when it hasn't even been implemented yet. -- nosy: +ammar2 resolution: -> postponed stage: -> resolved status: ope

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

2018-07-27 Thread Ammar Askar
Change by Ammar Askar : -- pull_requests: +8016 ___ Python tracker <https://bugs.python.org/issue29097> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2018-07-27 Thread Ammar Askar
Change by Ammar Askar : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34406] Typo in documentation

2018-08-14 Thread Ammar Askar
Ammar Askar added the comment: For what its worth, window's reg command also makes a distinction between the registry key and value: C:\Users\ammar>reg.exe QUERY HKLM\Software\Microsoft\.NETFramework\Enable64Bit ERROR: The system was unable to find the specified registry key or v

[issue34398] Docs search does not index glossary

2018-08-15 Thread Ammar Askar
Ammar Askar added the comment: Hmm, are you sure its not indexed? Look at this search result: https://docs.python.org/3/search.html?q=__slots__ The glossary page shows up in the results for me. Or are you suggesting that if you search for a term defined in the glossary, it be prominently

[issue34372] Compiler could output more accurate line numbers

2018-08-15 Thread Ammar Askar
Ammar Askar added the comment: Note that even just adding an extra arithmetic in your first expression breaks the line numbers: >>> code = """( ... [

[issue34372] Parenthesized expression has incorrect line numbers

2018-08-15 Thread Ammar Askar
Change by Ammar Askar : -- title: Compiler could output more accurate line numbers -> Parenthesized expression has incorrect line numbers ___ Python tracker <https://bugs.python.org/issu

[issue34398] Docs search does not index glossary items

2018-08-15 Thread Ammar Askar
Change by Ammar Askar : -- keywords: +patch pull_requests: +8248 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34398> ___ ___ Py

[issue34398] Docs search does not index glossary items

2018-08-15 Thread Ammar Askar
Ammar Askar added the comment: I think showing glossary results up top in the search page is a good idea, so I wrote up a quick proof of concept sphinx extension to do so. The diff isn't very big or complicated but it does need a bit of cleanup, especially the javascript and present

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-08-30 Thread Ammar Askar
Ammar Askar added the comment: For some empirical data, I went through some popular packages that follow this pattern and searched for usage of their base exception classes: Requests: https://github.com/search?q=except+requests.RequestException&type=Code PyYaml: https://github.com/sear

[issue34605] Avoid master/slave terminology

2018-09-07 Thread Ammar Askar
Ammar Askar added the comment: Do you have examples of where this occurs? >From >https://github.com/python/cpython/search?p=1&q=master+slave&unscoped_q=master+slave > I really only found the openpty function, and the man pages/argument names >there already use th

[issue34605] Avoid master/slave terminology

2018-09-07 Thread Ammar Askar
Ammar Askar added the comment: The libregrtest change looks good but I disagree on the pty/openpty changes. If you look at all the current Linux man pages and documentation, they follow the master/slave terminology. Generally, Python documentation for underlying os functions like fork, stat

[issue34605] Avoid master/slave terminology

2018-09-08 Thread Ammar Askar
Ammar Askar added the comment: Most of the opposition seems to be against a blanket replacing of all master and slave usages, which seems fairly reasonable to me. For example, I'm all for the libregrtest change since it conveys the meaning just as well and is an internal tool. Ho

[issue34683] Caret positioned wrong for SyntaxError reported by ast.c

2018-09-15 Thread Ammar Askar
Change by Ammar Askar : -- keywords: +patch pull_requests: +8761 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34683> ___ ___ Py

[issue34683] Caret positioned wrong for SyntaxError reported by ast.c

2018-09-15 Thread Ammar Askar
Ammar Askar added the comment: Added a PR that is an implementation of Benjamin's suggestion. The column offset returned has been made 0-indexed and errors now point to the start of the parsed token. This makes errors like `def class` show up as def class ^ instead of def

[issue34721] json module loads function

2018-09-18 Thread Ammar Askar
Ammar Askar added the comment: This is intentional, the parsed in JSON doesn't necessarily have to have an object at the root. This is also what allows you to do: >>> json.loads("[]") [] This behavior is also consistent with browsers, try this in your browser'

[issue34772] Python will suddenly not plot

2018-09-22 Thread Ammar Askar
Ammar Askar added the comment: Hey heiahh, This bug tracker is for issues pertaining to the python interpreter itself. You'd be better off asking your question on the matplotlib bug tracker or stack overflow: https://github.com/matplotlib/matplotlib/issues https://stackoverflo

[issue34683] Caret positioned wrong for SyntaxError reported by ast.c

2018-09-25 Thread Ammar Askar
Ammar Askar added the comment: There's some context on the github PR but essentially it boiled down to: - It would make it inconsistent with line offsets which are 1-indexed. - Breaking change to a public C API (PyErr_SyntaxLocationObject) - IDLE and other tools that catch syntax errors

[issue34810] Maximum and minimum value of C types integers from Python

2018-09-28 Thread Ammar Askar
Ammar Askar added the comment: What is the use case for getting the maximum and minimum of the fixed bit integers like `uint8`? It's a trivial formula to calculate those. Now, if you're talking about platform dependent types like `int` and `long` then it might makes more sense t

[issue34853] Python django cors

2018-09-30 Thread Ammar Askar
Ammar Askar added the comment: Hey Anel, this bug tracker is for issues with the Python language itself, not its libraries or usage. Try the flask-cors issue tracker or stackoverflow for more help-oriented questions: https://github.com/corydolphin/flask-cors https://stackoverflow.com

[issue34859] python core in string substring search

2018-10-01 Thread Ammar Askar
Ammar Askar added the comment: Please read this excerpt from the documentation Ronald linked for open: newline controls how universal newlines mode works (it only applies to text mode). It can be None, '', '\n', '\r', and '\r\n'. It works as follows:

[issue34838] Improve arg clinic code generation for cases with type checking

2018-10-01 Thread Ammar Askar
Change by Ammar Askar : -- keywords: +patch pull_requests: +9052 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34838> ___ ___ Py

[issue34838] Improve arg clinic code generation for cases with type checking

2018-10-01 Thread Ammar Askar
Ammar Askar added the comment: I've attached a PR that implements this. From the looks of it, there aren't a lot of uses of subclass_of within argument clinic converted functions at the moment. Additionally, most of the places it is used tend to have some non object arguments so

[issue34867] Add mode to disable small integer and interned string caches

2018-10-01 Thread Ammar Askar
Ammar Askar added the comment: Maybe something more akin to UndefinedBehaviorSanitizer? Since its supposed to be catching implementation specific quirks. It wouldn't really be sanitizing though, more just making the bugs more likely to appear. -- nosy: +a

[issue34867] Add mode to disable small integer and interned string caches

2018-10-01 Thread Ammar Askar
Ammar Askar added the comment: Serhiy, take a look at the linked ticket. The idea is that something like pytest or libregrtest will use this to bring underlying bugs to the surface. It isn't intended to be used in normal execution. -- ___ P

[issue34867] Add mode to disable small integer and interned string caches

2018-10-01 Thread Ammar Askar
Ammar Askar added the comment: Aah sorry, I misinterpreted what you meant. The original ticket proposes it as a compile time flag as well. -- ___ Python tracker <https://bugs.python.org/issue34

[issue34875] Change .js mime to "test/javascript"

2018-10-02 Thread Ammar Askar
Ammar Askar added the comment: It should be noted that the HTML spec also says: The term "JavaScript" is used to refer to ECMA-262, rather than the official term ECMAScript, since the term JavaScript is more widely known. Similarly, the MIME type used to refer to JavaScri

[issue34876] Python3.8 changes how decorators are traced

2018-10-02 Thread Ammar Askar
Ammar Askar added the comment: It looks like this is caused by https://github.com/python/cpython/commit/da8d72c953369b872a12c13f136ada77a786714a Adding Serhiy to the nosy list. -- nosy: +ammar2, serhiy.storchaka ___ Python tracker <ht

[issue34838] Improve arg clinic code generation for cases with type checking

2018-10-03 Thread Ammar Askar
Ammar Askar added the comment: Aah, I didn't know that ticket existed. Thanks for the link Serhiy, I'll review your PR instead. Leaving it up to Raymond if he wants to close the issue and use the other one to track this. -- ___ Pyth

[issue23867] Argument Clinic: inline parsing code for 1-argument functions

2018-10-16 Thread Ammar Askar
Change by Ammar Askar : -- nosy: +ammar2 ___ Python tracker <https://bugs.python.org/issue23867> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35023] Missed a key when iterating over dictionary

2018-10-18 Thread Ammar Askar
Ammar Askar added the comment: Modifying containers while iterating over them is generally not safe. In this case the iterator at the point you start the loop will contain all the items to iterate over, adding them mid-loop will not cause them to be iterated over. Take a look at the last

[issue35023] Missed a key when iterating over dictionary

2018-10-18 Thread Ammar Askar
Ammar Askar added the comment: Think about what it means to iterate over a hashmap. Let's say your pop() causes the dictionary to become smaller than the resizing threshold and now the indexes need to be rebuilt, how would this be handled gently by the iterator? This situation is not

[issue34991] variable type list [] referential integrity data loss

2018-10-19 Thread Ammar Askar
Ammar Askar added the comment: Echoing what Eric and Steven said: please create a more minimal example of what you think the problem is. I'm closing this ticket now since it seems like you found the issue? Feel free to re-open if you can come up with a better example or describe the pr

[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread Ammar Askar
Ammar Askar added the comment: The documentation also goes on to say that its default value is '/'. It is optional in the sense that the function can be called without providing it. It doesn't mean that `None` is somehow a valid type for it. Consider the open function for

[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread Ammar Askar
Ammar Askar added the comment: I would say so since the documentation says: safe parameter specifies additional ASCII characters None isn't really a set of ASCII characters but the empty string and empty list are. -- ___ Python tracker &

[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread Ammar Askar
Ammar Askar added the comment: Does rewording that prior part to "safe parameter specifies an iterable of additional ASCII characters" make it less confusing? -- ___ Python tracker <https://bugs.python.o

[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread Ammar Askar
Ammar Askar added the comment: I agree that urllib.parse.quote("/", safe=['/']) should probably work. It looks like the reason it doesn't is because quote tries to normalize the safe iterable to ASCII characters only. As part of this it attempts to run `< 128`

[issue35107] untokenize() fails on tokenize output when a newline is missing

2018-10-29 Thread Ammar Askar
Ammar Askar added the comment: Looks like this is caused by this line here: https://github.com/python/cpython/blob/b83d917fafd87e4130f9c7d5209ad2debc7219cd/Lib/tokenize.py#L551-L558 which adds a newline token implicitly after comments. Since the input didn't terminate with a '\n&

[issue35107] untokenize() fails on tokenize output when a newline is missing

2018-10-29 Thread Ammar Askar
Ammar Askar added the comment: fwiw I think there's more at play here than the newline change. This is the behavior I get on 3.6.5 (before the newline change is applied). # works as expected but check out this input: >>> t.untokenize(tokenize.generate_tokens(io.StringIO

[issue35107] untokenize() fails on tokenize output when a newline is missing

2018-10-29 Thread Ammar Askar
Ammar Askar added the comment: Actually nevermind, disregard that, I was just testing it wrong. I think the simplest fix here is to add '#' to the list of characters here so we don't double insert newlines for comments: https://github.com/pyth

<    1   2   3   4   5   >