[issue45544] Close 2to3 issues and list them here

2021-10-20 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- pull_requests: +27388 pull_request: https://github.com/python/cpython/pull/15249 ___ Python tracker <https://bugs.python.org/issue45

[issue45544] Close 2to3 issues and list them here

2021-10-20 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- pull_requests: +27386 pull_request: https://github.com/python/cpython/pull/14835 ___ Python tracker <https://bugs.python.org/issue45

[issue45544] Close 2to3 issues and list them here

2021-10-20 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- nosy: +aldwinaldwin nosy_count: 2.0 -> 3.0 pull_requests: +27382 pull_request: https://github.com/python/cpython/pull/15268 ___ Python tracker <https://bugs.python.org/issu

Re: Basic python question

2019-10-02 Thread Aldwin Pollefeyt
Seems to work also: >>> [x,y] = output.split() On Thu, Oct 3, 2019 at 12:17 PM Aldwin Pollefeyt wrote: > Oh, sorry .. please try this: > > >>> x,y = tuple(output.split()) > > On Thu, Oct 3, 2019 at 12:11 PM Jagga Soorma wrote: > >> Thanks Aldwin th

Re: Basic python question

2019-10-02 Thread Aldwin Pollefeyt
ed your example and did: > x,y = set(output.split()) > > My assumption would be that x should be 7 and y should be 2. However, > when I print x and y it seems to be reversed (x is 2 and y is 7). Am > I missing something? > > Thanks > > On Wed, Oct 2, 2019 at

Re: Basic python question

2019-10-02 Thread Aldwin Pollefeyt
You could use: >>> x, y = set(output.split()) On Thu, Oct 3, 2019 at 11:44 AM Jagga Soorma wrote: > Hello, > > I am new to python and trying to do some basic things with python. I > am writing a script that runs a df command and I need parts of that > output saved in 2 different variables.

Re: numpy results in segmentation fault

2019-09-19 Thread Aldwin Pollefeyt
use: num_arr1 = numpy.array(tgt_arr1, dtype=int) num_arr2 = numpy.array(tgt_arr2, dtype=int) On Mon, Sep 16, 2019 at 5:36 PM Pradeep Patra wrote: > Yes it is crashing in the hackerrank site and the testcases fails with > segmentation fault. I tried to install numpy with 3.7.3 and it is for

Re: Style suggestions/critiques

2019-08-20 Thread Aldwin Pollefeyt
The Zen of Python is readability? Does this look neater? x11, y11, x12, y12, x21, y21, x22, y22 = line1[0] + line1[1] + line2[0] + line2[1] Compared to tuples, lists are maybe more useful if you need to manipulate the coordinates. line1 = [ [1, 2], [3, 4] ] line1[1][0] = 5 line1[0] = [2, 3] or

[issue5664] 2to3 wont convert Cookie.Cookie properly

2019-08-14 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- nosy: +aldwinaldwin ___ Python tracker <https://bugs.python.org/issue5664> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5664] 2to3 wont convert Cookie.Cookie properly

2019-08-14 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- keywords: +patch pull_requests: +14990 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15268 ___ Python tracker <https://bugs.python.org/iss

[issue12611] 2to3 crashes when converting doctest using reduce()

2019-08-13 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- nosy: +aldwinaldwin ___ Python tracker <https://bugs.python.org/issue12611> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12611] 2to3 crashes when converting doctest using reduce()

2019-08-13 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- pull_requests: +14970 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/15249 ___ Python tracker <https://bugs.python.org/issu

[issue37714] 2to3 tab Problems

2019-07-29 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: There is a reindent.py tool to help you in this case. After running the 2to3 on the FrisPy, I tried the reindent tool, and the example worked fine afterwards. $ wget https://raw.githubusercontent.com/python/cpython/master/Tools/scripts/reindent.py

[issue37655] Set subset operator docs

2019-07-22 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: For 'set < other' it says sub-set ... for 'set > other' is says super-set. Subset vs superset. So I think it's correct in the documentation. -- nosy: +aldwinaldwin ___ Python tracker <https://bugs.p

[issue31689] random.choices does not work with negative weights

2019-07-19 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: issue37624: not adding an extra O(n) step to check for unusual inputs with undefined meaning -- that would just impair the normal use cases for near zero benefit. -- nosy: +aldwinaldwin ___ Python tracker

[issue37624] random.choices has unexpected behavior with negative weights

2019-07-18 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- keywords: +patch pull_requests: +14644 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14854 ___ Python tracker <https://bugs.python.org/issu

[issue37624] random.choices has unexpected behavior with negative weights

2019-07-18 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: This is what happens with your weights: >>> list(itertools.accumulate(weights)) [1, 2, 1, 2, 3, 3, 4] using bisect.bisect certain amount of times, will distribute on this: a<1 <https://bugs.python

[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-18 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: just guessing ... in 2.7 unix.rst has '\ No newline at end of file' it's your enhancement/call, but indeed no need to put energy in 2.7 doc anymore. case closed -- ___ Python tracker <https://bugs.python.

[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-18 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- nosy: +aldwinaldwin ___ Python tracker <https://bugs.python.org/issue37610> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-18 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- pull_requests: +14641 pull_request: https://github.com/python/cpython/pull/14850 ___ Python tracker <https://bugs.python.org/issue37

[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-18 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- keywords: +patch pull_requests: +14640 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/14849 ___ Python tracker <https://bugs.python.org/issu

[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2019-07-18 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: * there were many small issues with the patch, improved as good as possible the FixString to catch ```import as```, ```from string import *``` and ```import string``` * did not include the FixStringImports as it's not a necessity to work in Python3

[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2019-07-18 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- pull_requests: +14626 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/14835 ___ Python tracker <https://bugs.python.org/issu

Re: Want to learn python as I have donne manual testing for 12 years. Please help to share opinion how to start. Thanks

2019-07-15 Thread Aldwin Pollefeyt
Try to find small projects to solve with Python instead of using other applications. Hereby my experience: * solve or just represent a riddle or mathematical question. - Youtube channels called standupmaths and numberphile has some interesting videos about algorithms. Then it's fun trying to

[issue37570] `distutils.util.byte_compile` fails indirect byte compiling with non-ASCII full-path.

2019-07-12 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: FYI, PEP597 is created to avoid these issues (i think), target Python 3.9. https://www.python.org/dev/peps/pep-0597/ https://discuss.python.org/t/use-utf-8-as-default-text-file-encoding/1785 -- ___ Python

Re: How Do You Replace Variables With Their Values?

2019-07-11 Thread Aldwin Pollefeyt
On Fri, Jul 12, 2019 at 12:10 PM Ben Finney wrote: > Aldwin Pollefeyt writes: > > > dinner = {'Starters':['Fried Calamari', 'Potted crab'],'Main > > Course':['Fish', 'Meat'], 'Desert':['Cake', 'Banana Split']} > > > > # Don't ask where I got the dinner from > >

[issue37570] `distutils.util.byte_compile` fails indirect byte compiling with non-ASCII full-path.

2019-07-11 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: All 'The byte compiling test seems succeeded.' when i tested your script on ubuntu 18.04 on latest 3.7.4rc2+, 3.8.0b1+ and 3.9.0a0. What are the exact python versions and the OS version you see the issue? -- nosy: +aldwinaldwin

[issue37566] Remove redudant code in socket.py

2019-07-11 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: seems it is/was used in socket._socketobject in 2.7 -- nosy: +aldwinaldwin ___ Python tracker <https://bugs.python.org/issue37

Re: How Do You Replace Variables With Their Values?

2019-07-11 Thread Aldwin Pollefeyt
dinner = {'Starters':['Fried Calamari', 'Potted crab'],'Main Course':['Fish', 'Meat'], 'Desert':['Cake', 'Banana Split']} # Don't ask where I got the dinner from for meal in dinner.keys(): exec(meal.replace(' ','_') + ' = list(dinner[meal])') print(Starters) print(Main_Course) print(Desert)

[issue37545] Argparse Tutorial - unreasonable operators

2019-07-11 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: @Zachary, you are right ... the last one should be >= 1. Now i see the difference with the previous examples. It changed the output drastically from "the square of {} equals {}" vs "{}^2 == {}" to suddenly printing the filename at

[issue37545] Argparse Tutorial - unreasonable operators

2019-07-10 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: The >= is unnecessary in this exact example, as is correctly noted by Nathan. I understand using >= for future purposes, after you explained, what is also correct but confusing because you specifically describe why you change the >= 2, but it doe

[issue37545] Argparse Tutorial - unreasonable operators

2019-07-10 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- nosy: +aldwinaldwin ___ Python tracker <https://bugs.python.org/issue37545> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37545] Argparse Tutorial - unreasonable operators

2019-07-10 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- keywords: +patch pull_requests: +14497 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14697 ___ Python tracker <https://bugs.python.org/issu

[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-07-10 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- keywords: +patch pull_requests: +14496 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14696 ___ Python tracker <https://bugs.python.org/issu

[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-07-10 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: Changing everything to utf-8 breaks a lot of tests, so here a less invasive solution? diff --git a/Lib/email/header.py b/Lib/email/header.py index 4ab0032bc6..1e71eeae7f 100644 --- a/Lib/email/header.py +++ b/Lib/email/header.py @@ -136,7 +136,14 @@ def

[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-07-09 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: Maybe a solution, if no charset defined, then encode it as utf-8 in decode_header, because it's Python3's default encoding? diff --git a/Lib/email/header.py b/Lib/email/header.py index 4ab0032bc6..8dbfe58a57 100644 --- a/Lib/email/header.py +++ b/Lib/email

[issue37500] 3.8.0b2 no longer optimizes away "if 0:" ?

2019-07-04 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: FWIW: this is probably since PR14099 -- nosy: +aldwinaldwin ___ Python tracker <https://bugs.python.org/issue37500> ___ ___

[issue37495] socket.inet_aton parsing issue on some libc versions

2019-07-03 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: indeed, can confirm that a string starting with valid ip address and a space followed with anything, will not trigger the exception. do_ping('1.1.1.1 1.256.300.1 ; whoami') => no exception -- ___ Python trac

[issue37495] socket.inet_aton parsing issue on some libc versions

2019-07-03 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: >From : >https://docs.python.org/3.9/library/subprocess.html#security-considerations Security Considerations Unlike some other popen functions, this implementation will never implicitly call a system shell. This means that all characters, including

Re: What's wrong on using Popen's communicate method?

2019-07-03 Thread Aldwin Pollefeyt
This is same as echo abcd | notepad.exein Command Prompt. You won't see the abcd neither. On Thu, Jul 4, 2019 at 8:41 AM Chris Angelico wrote: > On Thu, Jul 4, 2019 at 10:01 AM wrote: > > > > I have the test0.py below. I expect to see 'abcd' showing in the notepad > window: > > -

[issue37490] poor documentation for .startswith, .endswith

2019-07-03 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: correction: ... otherwise, text.startswith(prefix, start, end) gives the same result as text[start:end].startswith(prefix). -- ___ Python tracker <https://bugs.python.org/issue37

[issue37490] poor documentation for .startswith, .endswith

2019-07-03 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: Modified from re module Pattern.search: The optional second parameter 'start' gives an index in the string where the search is to start; it defaults to 0. The optional parameter 'end' limits how far the string will be searched

[issue37490] poor documentation for .startswith, .endswith

2019-07-03 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: * text.startswith(prefix, start, end) seems the same as text[start:end].startswith(prefix) * text[start:end] with end>len(text) seems no issue, so also not an issue for startswith * text[8:12] in ('day', 'month', 'year') is not the same at all, rat

[issue37459] importlib docs improperly reference get_resource_loader()

2019-07-02 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- keywords: +patch pull_requests: +14386 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14568 ___ Python tracker <https://bugs.python.org/issu

[issue37436] os.path.isfile() with big number cause OverflowError: fd is greater than maximum

2019-06-27 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: Integers seems to be accepted, so not a TypeError? Maybe documentation needs some more information. Documentation os.path under os.path.exists(path): Changed in version 3.3: path can now be an integer: True is returned if it is an open file descriptor

[issue37416] If threading is not imported from the main thread it sees the wrong thread as the main thread.

2019-06-27 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: Understood. Thank you for the extra info. I'll read up on all the suggestions. -- ___ Python tracker <https://bugs.python.org/issue37

[issue37416] If threading is not imported from the main thread it sees the wrong thread as the main thread.

2019-06-27 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: The second import actually doesn't happen. You need to reload it. This can be tested by putting print('loading threading') in threading.py. Your first method-thread will still think it's main thread. So no idea if this is a bug or wrong use. 'import

[issue37327] python re bug

2019-06-18 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: neither the banner contains "

[issue37327] python re bug

2019-06-18 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: When I run the regex on https://regex101.com/, after some small adjustments ("HTTP\/1\.0" and "\/head"), it mentions 'Catastrophic backtracking has been detected and the execution of your expression has been halted.' I don't kn

[issue24255] Replace debuglevel-related logic with logging

2019-06-17 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: PR waiting review, Stage should be 'patch review' -- nosy: +aldwinaldwin ___ Python tracker <https://bugs.python.org/issue24

[issue25567] shlex.quote doesn't work on bytestrings

2019-06-14 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: Python 3.9.0a0 [GCC 7.3.0] on linux >>> import re >>> find_unsafe_bytes = re.compile(b'[^\w@%+=:,./-]').search :1: SyntaxWarning: invalid escape sequence \w when removing \w, all the tests pass (my regex knowledge is close to None.) &q

[issue37273] from pickle import rick

2019-06-13 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: It is Pickle Rick from Rick and Morty. https://en.wikipedia.org/wiki/Pickle_Rick No need to be in python libraries. But you can make your own library on github with this kind of art. :) -- nosy: +aldwinaldwin

[issue37030] Lib/cmd.py: Hide undocumented commands in help and completenames

2019-06-07 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: Can there be a review of the PR to let me know if all changes are correct? -- ___ Python tracker <https://bugs.python.org/issue37

[issue37147] f-string debugging f"{x=[}" adds [filename:lineno] as prefix

2019-06-04 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: Can use: import logging l = logging.Logger("") h = logging.StreamHandler() f = logging.Formatter(fmt="[{filename}:{lineno}] {msg}", style="{") h.setFormatter(f) l.addHandler(h) l.info("Hello") Output: >py .

[issue37147] f-string debugging f"{x=[}" adds [filename:lineno] as prefix

2019-06-04 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: Ok, didn't know about discuss.python.org. Searching on all PR and bpo's there was no reference to your hack. Will investigate this discuss.python.org. Ai ai ai, more info to read. -- ___ Python tracker <ht

[issue37147] f-string debugging f"{x=[}" adds [filename:lineno] as prefix

2019-06-04 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- keywords: +patch pull_requests: +13684 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13799 ___ Python tracker <https://bugs.python.org/issu

[issue37147] f-string debugging f"{x=[}" adds [filename:lineno] as prefix

2019-06-04 Thread Aldwin Pollefeyt
New submission from Aldwin Pollefeyt : >From this idea [0] by Karthikeyan Singaravelan and added to his code in hack >[1]. name = "karthikeyan" print(f"{name =[}") print(f"{name=[}") print(f"{age = [}") print(f"{age= [}") [prog

[issue37030] Lib/cmd.py: Hide undocumented commands in help and completenames

2019-06-02 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: How to add a label 'awaiting core review' to pull request? tirkarthi: "Left comment for doc and test. But in general would like to hear from a core dev on this." -- ___ Python tracker <https://bu

[issue13214] Cmd: list available completions from the cmd.Cmd subclass and filter out EOF handler(s)

2019-05-29 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: The EOF mentioned in msg309788 is the first reason why I searched in the library code for a solution. Then saw it as an opportunity to create hidden functions in the shell. So I created issue37030 [0] and PR13536 [1]. Later got notified about this thread

[issue37030] Lib/cmd.py: Hide undocumented commands in help and completenames

2019-05-29 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: The EOF mentioned in [0] is indeed the same and was the first reason why I searched in the library code for a solution. Then saw it as an opportunity to create hidden functions in the shell. [0] https://bugs.python.org/issue13214#msg309788

[issue37030] Lib/cmd.py: Hide undocumented commands in help and completenames

2019-05-24 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- keywords: +patch pull_requests: +13450 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue37030> ___ _

[issue37030] Lib/cmd.py: Hide undocumented commands in help and completenames

2019-05-24 Thread Aldwin Pollefeyt
New submission from Aldwin Pollefeyt : A flag, defaulting to false. If true, :meth:`do_help` and :meth:`completenames` won't include undocumented commands (that is, there are do_*() methods without corresponding help_*() methods). -- components: Library (Lib) messages: 343346 nosy