[issue34849] Drop logging when asyncio waits in selector.select()

2018-09-29 Thread miss-islington
miss-islington added the comment: New changeset d5bd036138881bb90a803397d992870a46fbdc2d by Miss Islington (bot) (Andrew Svetlov) in branch 'master': bpo-34849: Don't log wating for selector.select in asyncio loop iteration (GH-9641)

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Glen D souza
i have a approach, it may not be best fld = [ ] for data in shlex.split(ln): fld.append(data) On Sat, 29 Sep 2018 at 07:52, wrote: > On Friday, September 28, 2018 at 11:03:17 AM UTC-7, Chris Green wrote: > > I have a list created by:- > > > > fld = shlex.split(ln) > > > > It may

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Glen D souza
fld = [ ] data = shlex.split(ln) for item in data: fld.append(item) fld = fld + [0] * (5 - len(data)) On Sat, 29 Sep 2018 at 11:03, Glen D souza wrote: > i have a approach, it may not be best > > fld = [ ] > for data in shlex.split(ln): >fld.append(data) > > > > On Sat, 29 Sep

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Chris Angelico
On Sat, Sep 29, 2018 at 12:21 PM Chris Green wrote: > > I have a list created by:- > > fld = shlex.split(ln) > > It may contain 3, 4 or 5 entries according to data read into ln. > What's the neatest way of setting the fourth and fifth entries to an > empty string if they don't (yet) exist?

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Alister via Python-list
On Fri, 28 Sep 2018 19:00:29 +0100, Chris Green wrote: > I have a list created by:- > > fld = shlex.split(ln) > > It may contain 3, 4 or 5 entries according to data read into ln. What's > the neatest way of setting the fourth and fifth entries to an empty > string if they don't (yet) exist?

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Dan Sommers
On 9/28/18 2:00 PM, Chris Green wrote: I have a list created by:- fld = shlex.split(ln) It may contain 3, 4 or 5 entries according to data read into ln. What's the neatest way of setting the fourth and fifth entries to an empty string if they don't (yet) exist? Using 'if len(fld) < 4:'

[issue34849] Drop logging when asyncio waits in selector.select()

2018-09-29 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +9032 stage: -> patch review ___ Python tracker ___ ___

[issue34849] Drop logging when asyncio waits in selector.select()

2018-09-29 Thread Andrew Svetlov
New submission from Andrew Svetlov : The waiting is the pretty normal case: no IO is performed and no immediate activities are scheduled. Therefore logging such cases is just a noise. -- components: asyncio messages: 326702 nosy: asvetlov, yselivanov priority: normal severity: normal

[issue34745] asyncio ssl memory leak

2018-09-29 Thread Fantix King
Change by Fantix King : -- nosy: +fantix ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34848] range.index only takes one argument when it's documented as taking the usual 3

2018-09-29 Thread Dan Snider
New submission from Dan Snider : Unfortunately, it looks like there's no requirement for an abc.Sequence to implement the 3 argument form of seq.index, so I suppose this is technically just a documentation bug... >>> range(5).index(2, 1) Traceback (most recent call last): File "", line 1,

[issue34847] asyncio: Add PHA for TLS 1.3

2018-09-29 Thread Christian Heimes
Change by Christian Heimes : -- keywords: +patch pull_requests: +9031 stage: -> patch review ___ Python tracker ___ ___

[issue34847] asyncio: Add PHA for TLS 1.3

2018-09-29 Thread Fantix King
New submission from Fantix King : This was raised in GH-9460 where the same post handshake authentication (PHA) was added to the ssl module. It should be added to asyncio too. This issue is to discuss the design of PHA API in asyncio, and implement it in Python 3.8. One approach is to add

[issue32833] argparse doesn't recognise two option aliases as equal

2018-09-29 Thread paul j3
paul j3 added the comment: I'm going to close this issue. The current behavior is a logical consequence of how option_strings and abbreviations are handled. Handling this particular case differently would be require adding a special test, as opposed to a minor tweak to the current code.

[issue32756] argparse: parse_known_args: raising exception on unknown arg following known one

2018-09-29 Thread paul j3
Change by paul j3 : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue32291] Value error for string shared memory in multiprocessing

2018-09-29 Thread hongweipeng
hongweipeng added the comment: I think I know the reason. `c_wchar_p` corresponds to the string pointer `wchar_t *`.It's not a good idea to pass pointers between processes. As quoted from `multiprocessing` docs: Note Although it is possible to store a pointer in shared memory remember that

[issue34846] Runtime failure with Failed to import site module

2018-09-29 Thread Satheesh Thomas
New submission from Satheesh Thomas : Run time failure to execute python scripts. It was running for long time without any issue . But sometimes get this error which stops the entire execution. Looks like some .pyc file got corrupted . -- components: Build files: Python error1.png

[issue13407] tarfile doesn't support multistream bzipped tar files

2018-09-29 Thread Andrés Delfino
Change by Andrés Delfino : -- type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13407] tarfile doesn't support multistream bzipped tar files

2018-09-29 Thread Andrés Delfino
Andrés Delfino added the comment: I believe this can be closed. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue34785] pty.spawn -- auto-termination after child process is dead (a zombie)

2018-09-29 Thread Martin Panter
Martin Panter added the comment: Is this to get “spawn” working on a non-Linux platform like a recent Free BSD, OS X, or Solaris? If so, see Issue 26228. If not, you might have to explain your use case better. Polling for the child exiting is going to race with handling the child’s output,

[issue34845] allow exprlist as the iterators of comprehensions to be consistent with for statements

2018-09-29 Thread thautwarm
thautwarm added the comment: Well, sorry for that. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34845] allow exprlist as the iterators of comprehensions to be consistent with for statements

2018-09-29 Thread Guido van Rossum
Guido van Rossum added the comment: This is intentional. We don't want people accidentally writing e.g. [i for i in range(10), j for j in range(10)] -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue34845] allow exprlist as the iterators of comprehensions to be consistent with for statements

2018-09-29 Thread thautwarm
Change by thautwarm : -- components: +Interpreter Core type: -> behavior versions: +Python 3.8 ___ Python tracker ___ ___

[issue34845] allow exprlist as the iterators of comprehensions to be consistent with for statements

2018-09-29 Thread thautwarm
New submission from thautwarm : Currently we can use `exprlist` as the iterator in a `for` statement: ``` for i in 1, 2,: print(i) 1 2 ``` However, when it comes to comprehension expressions: ``` [i for i in 1, 2] SyntaxError: invalid syntax ``` I know there

[issue34844] logging.Formatter enhancement - Checking on style and fmt fields

2018-09-29 Thread Guido van Rossum
Guido van Rossum added the comment: Moving to Python 3.8 because this is a feature proposal. Adding Vinay to nosy list because this is about logging. -- nosy: +vinay.sajip versions: +Python 3.8 -Python 3.6 ___ Python tracker

[issue34844] logging.Formatter enhancement - Checking on style and fmt fields

2018-09-29 Thread Luna Chen
Change by Luna Chen : -- title: logging.Formatter enhancement - Checking on style and -> logging.Formatter enhancement - Checking on style and fmt fields ___ Python tracker

[issue34844] logging.Formatter enhancement - Checking on style and

2018-09-29 Thread Luna Chen
New submission from Luna Chen : Issue: Currently logging.Formatter does not check if the format passed in is valid style or if the field is valid when creating the logging.Formatter object. It would be nice to have such check in the constructor of the logging.Formatter. Here are 2

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2018-09-29 Thread Laurent Gautier
Laurent Gautier added the comment: Wouldn't a contiguity argument ('C' or 'F') be simpler ? (Independently, an argument strides is likely also missing from "cast"). Do you know what are the next possible steps here ? Bring this to the python-dev list ? Submit a patch ? --

[issue34842] Incorrect error messages in bisect

2018-09-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: not a bug -> out of date ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue34842] Incorrect error messages in bisect

2018-09-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Dan, thanks for the suggestion. Changing to PyObject_Size() would have been the right thing to do if the error message had not been fixed. But since the new error message "TypeError: dict is not a sequence" is more helpful than "TypeError: 'dict'

[issue13407] tarfile doesn't support multistream bzipped tar files

2018-09-29 Thread Brian Curtin
Brian Curtin added the comment: New changeset 8d3b0f49021e6cd25030a1eb979218cfceb44061 by Brian Curtin (Andrés Delfino) in branch '2.7': [2.7] bpo-13407: Mention that bz2/tarfile doesn't support multi-stream bzip2 files (GH-8428)

[issue27351] Unexpected ConfigParser.read() behavior when passed fileobject

2018-09-29 Thread Brian Curtin
Brian Curtin added the comment: New changeset 3cd5e8e83c9785d9f505138903c7a50dc964101e by Brian Curtin (Miss Islington (bot)) in branch '3.6': bpo-27351: Fix ConfigParser.read() documentation and docstring (GH-8123)

[issue27351] Unexpected ConfigParser.read() behavior when passed fileobject

2018-09-29 Thread Brian Curtin
Brian Curtin added the comment: New changeset b0b8f9bd4e6f78ac7383b4e56cfb6cbacc77da89 by Brian Curtin (Miss Islington (bot)) in branch '3.7': bpo-27351: Fix ConfigParser.read() documentation and docstring (GH-8123)

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2018-09-29 Thread mattip
mattip added the comment: Sorry, I meant a "strides" keyword. "shape" is already a valid keyword -- ___ Python tracker ___ ___

[issue27351] Unexpected ConfigParser.read() behavior when passed fileobject

2018-09-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +9029 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27351] Unexpected ConfigParser.read() behavior when passed fileobject

2018-09-29 Thread Brian Curtin
Brian Curtin added the comment: New changeset e45473e3ca31e5b78dc85cab575f5bb60d5b7f8f by Brian Curtin (Zackery Spytz) in branch 'master': bpo-27351: Fix ConfigParser.read() documentation and docstring (GH-8123)

[issue27351] Unexpected ConfigParser.read() behavior when passed fileobject

2018-09-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +9030 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32606] Email Header Injection Protection Bypass

2018-09-29 Thread Cheryl Sabella
Cheryl Sabella added the comment: Should this be closed as 'not a bug'? -- nosy: +cheryl.sabella ___ Python tracker ___ ___

[issue31370] Remove support for threads-less builds

2018-09-29 Thread Brian Curtin
Brian Curtin added the comment: New changeset eef059657d6b10babdb4831e1148d60cc644ee9a by Brian Curtin (Zackery Spytz) in branch 'master': bpo-31370: Remove references to threadless builds (#8805) https://github.com/python/cpython/commit/eef059657d6b10babdb4831e1148d60cc644ee9a --

[issue34832] "Short circuiting" in base64's b64decode, decode, decodebytes

2018-09-29 Thread Felipe Rodrigues
Felipe Rodrigues added the comment: For reference in future discussions, Python's base64 module implements RFC 3548 (https://tools.ietf.org/html/rfc3548) whose section 2.3 (https://tools.ietf.org/html/rfc3548#section-2.3) discusses about "Interpretation of non-alphabet characters in encoded

[issue34833] [CI] Azure Pipeline: Initialize Agent failed

2018-09-29 Thread Steve Dower
Steve Dower added the comment: I'll pass it along in case someone is collecting statistics on the team, but unless it's consistently broken for us (e.g. as apt-get was recently) there's not much value in opening a bug. Transient failures occur, ultimately, and nobody needs encouragement to

[issue34841] Script’s directory not in sys.path with embeddable Windows distribution

2018-09-29 Thread Simon Sapin
Simon Sapin added the comment: Removing python37._pth restores the documented behavior, I don’t know if it has adverse effects. -- ___ Python tracker ___

[issue34835] Multiprocessing module update fails with pip3

2018-09-29 Thread Cheryl Sabella
Cheryl Sabella added the comment: As Steven said, > In Python 2.6+ multiprocessing is a std lib module This means that multiprocessing will be current with the version of Python 3 that you have installed. If you're currently on 3.7.0, when 3.7.1 is released and you install it, you will get

Re: I am not able to run Python in Powershell

2018-09-29 Thread Calvin Spealman
Did you actually confirm the PATH variable contains the right path? echo $env:Path And look for a path entry that mentions Python. Then, make sure you can actually find python.exe in that location. As long as you keep the PATH option checked with the Python installer it absolutely should

[issue34843] logging cookbook docs: remove 'recent' when referring to multiprocessing

2018-09-29 Thread Cheryl Sabella
New submission from Cheryl Sabella : In the logging cookbook docs, the word 'recent' is used to describe versions of Python containing the multiprocessing module. Since multiprocessing is 10 years old, I think it may be safe to remove the word 'recent'. -- assignee: docs@python

[issue34843] logging cookbook docs: remove 'recent' when referring to multiprocessing

2018-09-29 Thread Cheryl Sabella
Change by Cheryl Sabella : -- keywords: +patch pull_requests: +9028 stage: -> patch review ___ Python tracker ___ ___

[issue34842] Incorrect error messages in bisect

2018-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was fixed in issue32500. This is a new feature and it was not backported. >>> bisect.bisect_right(dict.fromkeys(range(10)), 5) Traceback (most recent call last): File "", line 1, in TypeError: dict is not a sequence >>>

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Peter Otten
Ben Finney wrote: > Ben Finney writes: > >> You can use a comprehension, iterating over the full range of index you >> want:: >> >> words = shlex.split(line) >> padding_length = 5 >> words_padded = [ >> (words[index] if index < len(words)) >> for index in

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Ben Finney
Ben Finney writes: > You can use a comprehension, iterating over the full range of index you > want:: > > words = shlex.split(line) > padding_length = 5 > words_padded = [ > (words[index] if index < len(words)) > for index in range(padding_length)] That omits the

[issue34609] Importing certain modules while debugging raises an exception

2018-09-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think pperry nailed it above: > Pdb fails because it is attempting to import the readline module every time > its `trace_dispatch` is called, and the import implementation is not > reentrant in that way. More precisely, _ModuleLock.acquire() in

[issue32291] Value error for string shared memory in multiprocessing

2018-09-29 Thread hongweipeng
hongweipeng added the comment: This problem seems to be support for str. import multiprocessing import ctypes def child_process_fun(share): share.value = 'bb' if __name__ == '__main__': share = multiprocessing.Value(ctypes.c_wchar_p, 'aa') process =

[issue34842] Incorrect error messages in bisect

2018-09-29 Thread Dan Snider
New submission from Dan Snider : internal_bisect_left and internal_bisect_right use PySequence_Size when a "hi" argument wasn't provided, which causes this silly error message: >>> bisect.bisect_right(dict.fromkeys(range(10)), 5) Traceback (most recent call last): File "", line

[issue32291] Value error for string shared memory in multiprocessing

2018-09-29 Thread hongweipeng
Change by hongweipeng : -- nosy: +hongweipeng ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: JPEGImage() hangs

2018-09-29 Thread Chris Green
Cameron Simpson wrote: > On 28Sep2018 20:12, Chris Green wrote: > >Peter Pearson wrote: > >> On Fri, 28 Sep 2018 15:01:41 +0100, Chris Green wrote: > >> > Chris Green wrote: > >> >> Brian Oney wrote: > >> >> > Could you please try another tool like `convert'? E.g. > >> >> > > >> >> > $

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Chris Green
Thanks all, several possible ways of doing it there. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

[issue34841] Script’s directory not in sys.path with embeddable Windows distribution

2018-09-29 Thread Simon Sapin
New submission from Simon Sapin : https://docs.python.org/3/library/sys.html#sys.path documents: > As initialized upon program startup, the first item of this list, path[0], is > the directory containing the script that was used to invoke the Python > interpreter. On Windows with an

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Peter Otten
jlada...@itu.edu wrote: > On Friday, September 28, 2018 at 11:03:17 AM UTC-7, Chris Green wrote: >> I have a list created by:- >> >> fld = shlex.split(ln) >> >> It may contain 3, 4 or 5 entries according to data read into ln. >> What's the neatest way of setting the fourth and fifth entries

[issue33698] `._pth` does not allow to populate `sys.path` with empty entry

2018-09-29 Thread Simon Sapin
Change by Simon Sapin : -- nosy: +ssapin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28655] Tests altered the execution environment in isolated mode

2018-09-29 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I guess this can be safely closed as fixed since 3.6 changes were merged and I verified the PR changes locally at msg326477. The issue regarding using -I along with -j0 is tracked at issue34812 . Thanks Serhiy and Victor for the fixes :)

[issue34812] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-09-29 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks Victor for the details. Can this be classified as an easy issue? I guess the fix will be as below : 1. Add an entry for '-I' at https://github.com/python/cpython/blob/4b430e5f6954ef4b248e95bfb4087635dcdefc6d/Lib/subprocess.py#L260 2. Add

[issue34840] dlopen() error with no error message from dlerror()

2018-09-29 Thread shuoz
New submission from shuoz : python _ctypes.dlclose(arg). Never check the arg so we get a Segmentation fault (core dumped) poc.py ``` import _ctypes _ctypes.dlclose(3) # 3-4294967296 ``` python poc.py gdb info ```

[issue34751] Hash collisions for tuples

2018-09-29 Thread Tim Peters
Tim Peters added the comment: Jeroen, thanks for helping us fly slightly less blind! ;-) It's a lot of work. I'd say you may as well pick a prime. It's folklore, but "a reason" is that you've discovered that regular bit patterns in multipliers can hurt, and sticking to primes eliminates