[issue16055] incorrect error text for int(base=1000, x='1')

2017-11-12 Thread Sanyam Khurana

Change by Sanyam Khurana :


--
pull_requests: +4325
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31829] Portability issues with pickle

2017-11-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Updated PR correctly loads Unicode strings saved in text mode. As a mark used 
some corrected opcodes followed by newline. If any of previous newlines is 
\r\n, thus the file was written in text mode and is read in binary mode. If no 
opcodes with newlines was saved before the UNICODE opcode, the special no-op 
sequence STRING + "''\n" + POP is saved. This minimize overhead in common case.

I'm going to merge this PR and port some changes to Python 3. Could anybody 
please make a review of the documentation changes?

--
assignee:  -> serhiy.storchaka
versions: +Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31975] Add a default filter for DeprecationWarning in __main__

2017-11-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le 12/11/2017 à 02:17, Nick Coghlan a écrit :
> 
> If someone else wants a different change, they can write their own
> competing PEP that explains why they think mine would be worse than the
> status quo.

Nobody needs a PEP to advocate for the status quo.  The status quo wins
by default and you know it.  It's your responsibility, if you want to
change the status quo, to convince people that the changes you are
proposing are desirable.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28197] Add start and stop parameters to the range.index() ABC method

2017-11-12 Thread Nitish

Change by Nitish :


--
keywords: +patch
pull_requests: +4326
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31975] Add a default filter for DeprecationWarning in __main__

2017-11-12 Thread Nick Coghlan

Nick Coghlan  added the comment:

My impression is that you've been arguing that my changes don't go far enough 
(i.e. you'd prefer full reversion to the pre-2.7 behaviour), not that the 
status quo is superior.

My PEP covers both why I think the status quo is problematic, and why I no 
longer think full reversion would be a good idea (even though that was my 
original suggestion on python-dev). It also presents a list of additional known 
problems with the status quo that this particular PEP doesn't even attempt to 
address (although it does note some related possibilities for follow-on work if 
anyone is so inclined).

If you (or anyone else) would like to make the case for an alternative 
approach, then you either need to persuade Guido that the status quo is 
superior to my proposal to add a new default filter setting, *or* present a 
competing proposal that he prefers.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31975] Add a default filter for DeprecationWarning in __main__

2017-11-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le 12/11/2017 à 12:40, Nick Coghlan a écrit :
> 
> My impression is that you've been arguing that my changes don't go far enough 
> (i.e. you'd prefer full reversion to the pre-2.7 behaviour), not that the 
> status quo is superior.

Ideally yes.  That said, I also thought that the special case you were
proposing was pointless.

Now I've changed my mind though.  Your PEP makes a good convincing
argument.  Thanks for writing it!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8

2017-11-12 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset 1588be66d7b0eeebc4614309cd0fc837ff52776a by xdegaye in branch 
'master':
bpo-28180: Fix the implementation of PEP 538 on Android (GH-4334)
https://github.com/python/cpython/commit/1588be66d7b0eeebc4614309cd0fc837ff52776a


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31975] Add a default filter for DeprecationWarning in __main__

2017-11-12 Thread Nick Coghlan

Nick Coghlan  added the comment:

I relearned a fair bit myself in writing it - I'd completely forgotten the 
original rationale was about developer tools emitting unhelpful noise (rather 
than general Python applications), and that's far more persuasive than the 
rationale I'd misremembered (hence the change in my own position as the 
discussion went on).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31975] Add a default filter for DeprecationWarning in __main__

2017-11-12 Thread Nick Coghlan

Nick Coghlan  added the comment:

I also learned we need more concrete examples of useful PYTHONWARNINGS and -W 
settings in the docs - I believe PEP 565 currently contains more of those than 
all of our existing warnings related documentation put together :)

I'll look into that "warnings cookbook" aspect as part of putting a reference 
patch together for the PEP.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31993] pickle.dump allocates unnecessary temporary bytes / str

2017-11-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

While we are here, wouldn't be worth to flush the buffer in the C 
implementation to the disk always after committing a frame? This will save a 
memory when dump a lot of small objects.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31993] pickle.dump allocates unnecessary temporary bytes / str

2017-11-12 Thread Olivier Grisel

Olivier Grisel  added the comment:

Thanks Antoine, I updated my code to what you suggested.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31691] Include missing info on required build steps and how to build installer

2017-11-12 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

Indeed, other branches can use this info as well.

--
versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: 
https://bugs.python.org/file47260/0001-Add-missing-but-required-build-steps-and-how-to-buil.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31691] Include missing info on required build steps and how to build installer

2017-11-12 Thread Ivan Pozdeev

Change by Ivan Pozdeev :


Removed file: 
https://bugs.python.org/file47191/0001-Add-missing-build-steps-in-build-procedure.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31691] Include missing info on required build steps and how to build installer

2017-11-12 Thread Ivan Pozdeev

Change by Ivan Pozdeev :


Removed file: 
https://bugs.python.org/file47192/0001-Add-missing-build-steps-in-build-procedure.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32010] Multiple get "itemgetter"

2017-11-12 Thread Mario Corchero

New submission from Mario Corchero :

At the moment we can get an operator that performs multiple "gets" in object 
attributes. Example:

>>> getter = operator.attrgetter("child1.child2")
>>> o = mock.Mock()
>>> getter(o)


On the other hand, itemgetter -which can be used for mappings- can only access 
single level.

  a = itemgetter("a")(d)

The proposal is to add a way to perform multiple fetches the say way attrgetter 
is doing it.

The main worry here for me would be that it might break some existing callers 
if someone had "a.b" as a key in a dict and were using itemgetter.
An option might be a new argument separator to split those so it'd look like:

  d = dict(a=dict(b=1), b=dict(c=2)) 
  ab = itemgetter("a.b", separator=".")(d)

This is effectively sugar for: itemgetter("b")(itemgetter("a")(d))

This should be available in the *args version as well so the following is valid:

  d = dict(a=dict(b=1), b=dict(c=2)) 
  ab, ac = itemgetter("a.b", "b.c", separator=".")(d)


This is coming from python-dev mailing list thread: "[Python-Dev] Analog of PEP 
448 for dicts (unpacking in assignment with dict rhs)"

I have a sample implementation on the py side. If this is interesting I can 
send a PR with the full impl (I havent started yet with the C one)
If anyone is interested in the ongoing implementation: 
https://github.com/mariocj89/cpython/tree/multiple_itemgetter

--
components: Library (Lib)
messages: 306114
nosy: mariocj89
priority: normal
severity: normal
status: open
title: Multiple get "itemgetter"
type: enhancement
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32010] Multiple get "itemgetter"

2017-11-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

As you have said, this will break existing code.

And this is not applicable to non-string indices.

I think that it would be easier to use a lambda or local function for this: 
`lambda x: x['a']['b']`. It is shorter and cleaner.

I don't see how this is related to the Python-Dev thread.

--
nosy: +serhiy.storchaka
resolution:  -> rejected

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31993] pickle.dump allocates unnecessary temporary bytes / str

2017-11-12 Thread Olivier Grisel

Olivier Grisel  added the comment:

> While we are here, wouldn't be worth to flush the buffer in the C 
> implementation to the disk always after committing a frame? This will save a 
> memory when dump a lot of small objects.

I think it's a good idea. The C pickler would behave more like the Python 
pickler. I think framing was intended this way initially. Antoine what do you 
think?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31993] pickle.dump allocates unnecessary temporary bytes / str

2017-11-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Framing was originally intended to improve unpickling (since you don't have to 
issue lots of tiny file reads anymore).  No objection to also improve pickling, 
though :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30696] infinite loop in PyRun_InteractiveLoopFlags()

2017-11-12 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset e0582a37c8d1776a2fd4968e9216f3a05f780276 by xdegaye in branch 
'master':
bpo-30696: Fix the REPL looping endlessly when no memory (GH-4160)
https://github.com/python/cpython/commit/e0582a37c8d1776a2fd4968e9216f3a05f780276


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30696] infinite loop in PyRun_InteractiveLoopFlags()

2017-11-12 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
pull_requests: +4327

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android

2017-11-12 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset 92c2ca7633c881a56157f2fb8b2e1b8c7114e5fb by xdegaye in branch 
'master':
bpo-28759: Skip some tests on PermissionError raised by Android (GH-4350)
https://github.com/python/cpython/commit/92c2ca7633c881a56157f2fb8b2e1b8c7114e5fb


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30696] infinite loop in PyRun_InteractiveLoopFlags()

2017-11-12 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset ea5b545e38b3fec7ff29276b5cd59dec583ebf34 by xdegaye in branch 
'3.6':
[3.6] bpo-30696: Fix the REPL looping endlessly when no memory (GH-4160). 
(#4379)
https://github.com/python/cpython/commit/ea5b545e38b3fec7ff29276b5cd59dec583ebf34


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30696] infinite loop in PyRun_InteractiveLoopFlags()

2017-11-12 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31993] pickle.dump allocates unnecessary temporary bytes / str

2017-11-12 Thread Olivier Grisel

Olivier Grisel  added the comment:

Flushing the buffer at each frame commit will cause a medium-sized write every 
64kB on average (instead of one big write at the end). So that might actually 
cause a performance regression for some users if the individual file-object 
writes induce significant overhead.

In practice though, latency inducing file objects like filesystem-backed ones 
are likely to derive from the 
[BufferedWriter](https://docs.python.org/3/library/io.html#io.BufferedWriter) 
base class and the only latency we should really care about it the one induced 
by the write call overhead itself in which case the 64kB frame / buffer size 
should be enough.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android

2017-11-12 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
pull_requests: +4328

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31993] pickle.dump allocates unnecessary temporary bytes / str

2017-11-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Agreed.  We shouldn't issue very small writes, but 64 kB is generally 
considered a reasonable buffer size for many kinds of I/O.

Besides, it wouldn't be difficult to make the target frame size configurable if 
a use case arose for it, but I don't think we've ever had such a request.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29180] skip tests that raise PermissionError in test_os (non-root user on Android)

2017-11-12 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset 6a55d09573e5c35c9e4a24a6f811120b41a2a994 by xdegaye in branch 
'master':
bpo-29180: Skip test_os tests on PermissionError raised by Android (GH-4374)
https://github.com/python/cpython/commit/6a55d09573e5c35c9e4a24a6f811120b41a2a994


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29180] skip tests that raise PermissionError in test_os (non-root user on Android)

2017-11-12 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29181] skip tests that raise PermissionError in test_tarfile (non-root user on Android)

2017-11-12 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29181] skip tests that raise PermissionError in test_tarfile (non-root user on Android)

2017-11-12 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset d7d4fea4a39da4bfdea1de22fe040023eb4ddc17 by xdegaye in branch 
'master':
bpo-29181: Skip test_tarfile tests on PermissionError raised by Android 
(GH-4375)
https://github.com/python/cpython/commit/d7d4fea4a39da4bfdea1de22fe040023eb4ddc17


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28789] valgrind shows "invalid file descriptor" when calling platform.system() on my machine.

2017-11-12 Thread Stefan Krah

Change by Stefan Krah :


--
nosy: +skrah
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31975] Add a default filter for DeprecationWarning in __main__

2017-11-12 Thread Guido van Rossum

Guido van Rossum  added the comment:

> the original rationale was about developer tools emitting unhelpful noise
(rather than general Python applications)

I don't recall that, and I'm not sure I agree (either that this is a good
reason or that that was the reason stated when we originally silenced these
by default).

Have you found a specific historic message where this is brought up as the
deciding reason? Why would noise from developer tools be worse than noise
from other applications.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28789] valgrind shows "invalid file descriptor" when calling platform.system() on my machine.

2017-11-12 Thread Stefan Krah

Stefan Krah  added the comment:

More info:

==22845== Warning: invalid file descriptor 1024 in syscall close()
==22845==at 0x4E493F0: __close_nocancel (syscall-template.S:81)
==22845==by 0xF0BAA74: _close_open_fds_safe (_posixsubprocess.c:297)
==22845==by 0xF0BADF6: child_exec (_posixsubprocess.c:494)
==22845==by 0xF0BB8B9: subprocess_fork_exec (_posixsubprocess.c:691)
==22845==by 0x46D188: _PyMethodDef_RawFastCallKeywords (call.c:691)
==22845==by 0x46D2AC: _PyCFunction_FastCallKeywords (call.c:726)
==22845==by 0x5693CE: call_function (ceval.c:4663)
==22845==by 0x563DFA: _PyEval_EvalFrameDefault (ceval.c:3149)
==22845==by 0x5569EB: PyEval_EvalFrameEx (ceval.c:549)
==22845==by 0x56758D: _PyEval_EvalCodeWithName (ceval.c:4011)
==22845==by 0x46CA56: _PyFunction_FastCallKeywords (call.c:433)
==22845==by 0x56979A: call_function (ceval.c:4702)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android

2017-11-12 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset ad004f9b5a581f577374c56d8ab27e9ef2e73452 by xdegaye in branch 
'3.6':
[3.6] bpo-28759: Skip some tests on PermissionError raised by Android (GH-4350) 
(#4380)
https://github.com/python/cpython/commit/ad004f9b5a581f577374c56d8ab27e9ef2e73452


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android

2017-11-12 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32011] Restore loading of TYPE_INT64 in marshal

2017-11-12 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

TYPE_INT64 is supported in the marshal module since Python 1.5. Since its use 
causes instability of marhalled files produced on different platforms, the 
marshal module in Python 3.3 no longer use it when write new files (see 
issue15466). And in Python 3.4 it stopped reading files containing the 
TYPE_INT64 code (see issue15480).

This is backward incompatible change. Python 2.7 still produce files containing 
the TYPE_INT64 code (though this code is rare, because integers in ranges 
-9223372036854775808..-2147483649 and 2147483648..9223372036854775807 are 
rare), and there may be marshal files produced by older versions of Python 3, 
Python 2 and Python 1. Formally Python 3 supports marshal formats produced by 
all previous versions, except the code objects and the TYPE_INT64 code.

Supporting loading the TYPE_INT64 code don't create problems like using it for 
saving data. But it is needed for backward compatibility.

I think that removing the TYPE_INT64 code was a mistake.

--
assignee: serhiy.storchaka
components: Extension Modules
messages: 306128
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Restore loading of TYPE_INT64 in marshal
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28789] valgrind shows "invalid file descriptor" when calling platform.system() on my machine.

2017-11-12 Thread Stefan Krah

Stefan Krah  added the comment:

Okay, it is probably this:

  https://bugs.kde.org/show_bug.cgi?id=331311


The question is whether we should add a suppression or a perhaps
a comment in _posixsubprocess.c

--
nosy: +gregory.p.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32011] Restore loading of TYPE_INT64 in marshal

2017-11-12 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +4329
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32011] Restore loading of TYPE_INT64 in marshal

2017-11-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Example:

$ python2 -c 'import sys, marshal; marshal.dump(1234567890, sys.stdout)' | 
python3 -c 'import sys, marshal; print(marshal.load(sys.stdin.buffer))'
1234567890

$ python2 -c 'import sys, marshal; marshal.dump(123456789012345, sys.stdout)' | 
python3 -c 'import sys, marshal; print(marshal.load(sys.stdin.buffer))'
Traceback (most recent call last):
  File "", line 1, in 
ValueError: bad marshal data (unknown type code)

 python2 -c 'import sys, marshal; marshal.dump(12345678901234567890, 
sys.stdout)' | python3 -c 'import sys, marshal; 
print(marshal.load(sys.stdin.buffer))'
12345678901234567890

PR 4381 reverts this change and simplifies the restored code.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31975] Add a default filter for DeprecationWarning in __main__

2017-11-12 Thread R. David Murray

R. David Murray  added the comment:

My *personal* memory (as in, the reason I gave a sigh of relief when we made 
this change) was other tools, regardless of what core's rationale was :)  (If I 
remember correctly it was some sysadmin-type tool I was using just about every 
day.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32012] Disallow ambiguous syntax f(x for x in [1],)

2017-11-12 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

The syntax f(x for x in [1],) is ambiguous and reasons that allow it (omitting 
parenthesis in generator expression and using trailing comma in call 
expression) are not applicable in this case. Rationales see on Python-Dev: 
https://mail.python.org/pipermail/python-dev/2017-November/150481.html.

--
components: Interpreter Core
messages: 306132
nosy: benjamin.peterson, brett.cannon, ncoghlan, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Disallow ambiguous syntax f(x for x in [1],)
type: enhancement
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32012] Disallow ambiguous syntax f(x for x in [1],)

2017-11-12 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +4330
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31956] Add start and stop parameters to the array.index()

2017-11-12 Thread Anders Lorentsen

Anders Lorentsen  added the comment:

I decided to work on this, and I would like some review, as this would be my 
second contribution to cpython. Also, a general question:

As I defined the start and end arguments Py_ssize_t, bigger indexes (more 
negative or more positive) than what can fit in Py_ssize_t will trigger an 
overflow error. This should be OK, though, as other functions with index 
arguments has them as Py_ssize_t - and getarrayitem() itself accepts a 
Py_ssize_t. Or?

--
nosy: +Phaqui
Added file: https://bugs.python.org/file47261/WIP-issue-31956

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31975] Add a default filter for DeprecationWarning in __main__

2017-11-12 Thread Nick Coghlan

Nick Coghlan  added the comment:

Reviewing the original thread yet again, you're right the original decision 
wasn't specifically about developer tools (and I guess at some level I knew 
that, or I wouldn't have been motivated to suggest the change to 
FutureWarning's documented purpose).

That said, I consider noise from developer tools to be the most compelling 
example as:

1. Running them from the command line is their normal mode of use (unlike GUI 
apps which often have no visible console, implicitly silencing all warnings 
anyway)
2. It's routine for Python developers to run their developer tools on the 
latest version of Python, whereas regular applications are more likely to be 
pre-tested against a particular Python version these days
3. Mixing up warnings from a tool like pylint or mypy about the code it is 
analysing with deprecation warnings about pylint's own code is clearly going to 
be unhelpful and confusing, no matter how you feel about deprecation warnings 
in the general case

All the points that are most debatable for regular apps ("Do they even have a 
console?", "Why are end users supplying their own Python version?", "Why can't 
they just ignore the error?") have clear answers in the developer tools case 
that favour leaving deprecation warnings off by default.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31975] Add a default filter for DeprecationWarning in __main__

2017-11-12 Thread Guido van Rossum

Guido van Rossum  added the comment:

I simply don't think developer tools are the prime example of command line
tools (it's just that because we are Python developers here, *everything*
we use tends to be a developer tool). And "app" does not mean or imply "GUI
app".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31975] Add a default filter for DeprecationWarning in __main__

2017-11-12 Thread Nick Coghlan

Nick Coghlan  added the comment:

The default command line UX of Python developer tools is also more 
unambiguously python-dev's responsibility, though. That's where my own initial 
line of argument for full reversion (i.e. that we should be letting app 
developers manage their own stderr UX, not trying to manage it for them) fell 
down.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

2017-11-12 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

See also PEP 565.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32007] nis module fails to build against glibc-2.26

2017-11-12 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Rather than investing any effort in nis, we should probably just deprecate and 
eventually remove it.

(If glibc is actually getting rid of something, you know must be very very 
deprecated.)

--
nosy: +benjamin.peterson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32013] _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter()

2017-11-12 Thread Mathew M.

New submission from Mathew M. :

Hey there! I'm fairly new to the development process for Python, so I figured 
I'd start off with something tiny and then work on up from there. I'm not sure 
if this sort of minor fix warrants an issue being created, but I made this just 
to err on the safe side of things.

So, as far as I understand (by all means correct me if I'm wrong), a 
'Py_DECREF(key);' should be present before the return in the conditional within 
fast_save_enter() 
(https://github.com/python/cpython/blob/d7d4fea4a39da4bfdea1de22fe040023eb4ddc17/Modules/_pickle.c#L1792)

--
components: Extension Modules
messages: 306139
nosy: Mathew M.
priority: normal
severity: normal
status: open
title: _pickle: Py_DECREF seems to be missing from a failure case in 
fast_save_enter()
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32013] _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter()

2017-11-12 Thread Mathew M.

Change by Mathew M. :


--
keywords: +patch
pull_requests: +4331
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32010] Multiple get "itemgetter"

2017-11-12 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I also don't think this should be done to itemgetter() which should remain 
focused on its core task.

Thank you for the suggestion, but am marking this as closed.  Perhaps consider 
posting a recipe to the ASPN cookbook (I've posted a lot of ideas there) or 
publish something on PyPI to see if there is any uptake.

--
nosy: +rhettinger
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1539925] warnings in interactive sessions

2017-11-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Looks reasonable to me. Perhaps we should port the solution from IPython:
https://github.com/ipython/ipython/issues/6611.

--
versions: +Python 3.7 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32014] multiprocessing Server's shutdown method useless send message to manager

2017-11-12 Thread stevezh

New submission from stevezh :

When shutdown the manager, Server's handle_request will send back message to 
the manager, so is useless for the Server's shutdown method send back "None" to 
the manager?

Source code from Lib/multiprocessing/managers.py:

def shutdown(self, c):
'''
Shutdown this process
'''
try:
util.debug('manager received shutdown message')
# Is useless here?
c.send(('#RETURN', None))
except:
import traceback
traceback.print_exc()
finally:
self.stop_event.set()

Server's handle_request may throw and catch exception because the conn is 
closed in _finalize_manager() after Server's shutdown method returns.

code from handle_request():

try:
c.send(msg)
except Exception as e:
try:
c.send(('#TRACEBACK', format_exc()))
except Exception:
pass

code from _finalize_manager():

try:
conn = _Client(address, authkey=authkey)
try:
dispatch(conn, None, 'shutdown')
finally:
conn.close()
except Exception:
pass

Also the Server's shutdown method only used by manager class.

--
components: Library (Lib)
messages: 306142
nosy: davin, jnoller, pitrou, sbt, stevezh
priority: normal
severity: normal
status: open
title: multiprocessing Server's shutdown method useless send message to manager
type: behavior
versions: Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31956] Add start and stop parameters to the array.index()

2017-11-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Just take list.index as an example.

--
components: +Extension Modules -Library (Lib)
nosy: +serhiy.storchaka
type:  -> enhancement
versions: +Python 3.7 -Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31948] [EASY] Broken MSDN links in msilib docs

2017-11-12 Thread Akash Jain

Akash Jain  added the comment:

Hi,

I am new to contributing in Python, Can I work on this issue?

--
nosy: +Akash Jain

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32012] Disallow ambiguous syntax f(x for x in [1],)

2017-11-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 4382 doesn't change the grammar, it changes only checks in the CST to AST 
transformer. Maybe it would be better to change the grammar. Currently it 
doesn't match the language specification and allows the following constructions:

@deco(x for x in [1])
def f(): ...

class C(x for x in [1]): ...

And I think the part of issue27494 should be reverted.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27494] 2to3 parser failure caused by a comma after a generator expression

2017-11-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Actually this syntax isn't allowed by the Python language specification. See 
issue32012 for fixing the Python parser.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32013] _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter()

2017-11-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset f76231f89a7231fd486b37f728fbb4aab389e4d7 by Serhiy Storchaka (Mat 
M) in branch 'master':
bpo-32013: _pickle: Add missing Py_DECREF in error case in fast_save_enter() 
(#4384)
https://github.com/python/cpython/commit/f76231f89a7231fd486b37f728fbb4aab389e4d7


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32013] _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter()

2017-11-12 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4333

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com