[issue35089] Remove typing.io and typing.re from documentation

2018-10-28 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
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



[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2018-10-28 Thread Michael Felt

Michael Felt  added the comment:

re; the current status of PR8672 - which I shall probably close as it no longer 
merges.

@taleinat re: the need for lambda

As _find_mac_netstat() is only called once the need for the last two arguments 
may be unnecessary. My reason for including them was to keep _find_mac_netstat 
comparable to _find_mac.

1) I am reluctant to make changes to historical code, however, in this case it 
was needed as _find_mac has, imho, a requirement for input that differs from 
AIX netstat.

* On linux (debian, centos) I do not find a MAC address for netstat
* On linux, where, e.g., ifconfig does return a value - the lambda i: i±1 is 
vital as the value follows the keyword on the same line.
For AIX lambda I: i is needed because only the first line (header) has 
keywords, the remaining lines give the values.

Linux: ifconfig (keyword "ether")

root@x074:~# ifconfig
eth0: flags=4163  mtu 1500
inet 192.168.129.74  netmask 255.255.255.0  broadcast 192.168.129.255
inet6 fe80::f8d1:81ff:fe12:b104  prefixlen 64  scopeid 0x20
inet6 2001:981:56fd:1:f8d1:81ff:fe12:b104  prefixlen 64  scopeid 
0x0
ether fa:d1:81:12:b1:04  txqueuelen 1000  (Ethernet)
RX packets 1605776  bytes 177990366 (169.7 MiB)
RX errors 0  dropped 1027921  overruns 0  frame 0
TX packets 25045  bytes 1567902 (1.4 MiB)
TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
device interrupt 20


So, when the keyword is found, as each word on the line is examined "i+1" gives 
the value

For AIX (in anycase), the keyword is Address - the output is:
michael@x071:[/data/prj/python/git/python3-3.8]netstat -ia
Name  Mtu   Network Address   Ipkts IerrsOpkts Oerrs  Coll
en0   1500  link#2  fa.d1.8c.f7.62.4 2348009992 0 946551098 0 0
01:00:5e:00:00:01
en0   1500  192.168.129 x071 2348009992 0 946551098 0 0
224.0.0.1
en0   1500  192.168.90  x071 2348009992 0 946551098 0 0
224.0.0.1
en1   1500  link#3  fa.d1.8c.f7.62.5 64346336 0 89935059 0 0
01:00:5e:00:00:01
en1   1500  192.168.2   mail.aixtools.xx 64346336 0 89935059 0 0
224.0.0.1

Note - the value with colons - as many (all?) other systems - this seems to be 
a constant, and a value on a line all by itself - so the old code could never 
ever find it, even if it could have parsed it. The actual MAC address is on a 
line with several entries - matching the values given by the "header" line - so 
lambda i: i is needed to examine the later lines to find a suitably formatted 
value.

So, should I write _find_mac_netstat for AIX only (and maybe set "skipIf" 
Linux). There are many assumptions in this code. I do not feel qualified to 
change things I cannot test - so, as much as possible I follow the tried and 
true.

I hope this clarifies my intent well enough that you can make a decision.

--

___
Python tracker 

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



[issue35094] Improved algorithms for random.sample

2018-10-28 Thread Paul Crowley


New submission from Paul Crowley :

random.sample currently uses either a Fisher-Yates shuffle, or rejection 
sampling, to achieve sampling without replacement. I propose using reservoir 
sampling or "cardchoose"; these are similar performance or sometimes faster, 
and don't need to allocate anything except the list used for the results.

--
components: Library (Lib)
messages: 328728
nosy: ciphergoth
priority: normal
severity: normal
status: open
title: Improved algorithms for random.sample
type: resource usage
versions: Python 3.8

___
Python tracker 

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



[issue35085] FileNotFoundError: [Errno 2] No such file or directory:

2018-10-28 Thread TestUser


TestUser  added the comment:

How can that be CLI useful. Lucky I guess as this does not generate a Crash
Report. OK.

Bad/Missing File would have been my preferred. Then again?

Thanks

On Sun, Oct 28, 2018 at 1:48 AM Karthikeyan Singaravelan <
rep...@bugs.python.org> wrote:

>
> Karthikeyan Singaravelan  added the comment:
>
> I can see one another related report issue35084. As @steven.daprano said
> this is an expected traceback and it's working correctly. -d expects a
> valid base64 encoded file and supplying a non-existent file or file with
> invalid encoding is supposed to throw a traceback.
>
> --
> nosy: +xtreak
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue35090] Potential division by zero and integer overflow in allocator wrappers

2018-10-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9514
stage: resolved -> patch review

___
Python tracker 

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



[issue33396] IDLE: Improve and document help doc viewer

2018-10-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#35063 implements item 6, (initially) doc the help viewer.  When we improve the 
help viewer, we should revise the doc at the same time.

--
dependencies: +Checking for abstractmethod implementation fails to consider MRO 
for builtins

___
Python tracker 

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



[issue35090] Potential division by zero and integer overflow in allocator wrappers

2018-10-28 Thread STINNER Victor


Change by STINNER Victor :


--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue35047] Better error messages in unittest.mock

2018-10-28 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Petter Strandmark!

--
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



[issue35075] Doc: pprint example uses dead URL

2018-10-28 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Also this throws a TypeError, because http_info.get_content_charset() returns 
None with the new link. I think, this should be fixed as well.

--
nosy: +lys.nikolaou

___
Python tracker 

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



[issue33234] Improve list() pre-sizing for inputs with known lengths

2018-10-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset c61e229d2a4c54ffb4153e1f0f48126ba33c9cbf by Pablo Galindo in 
branch 'master':
bpo-33234: Add exact allocation optimization to lists in What's New (GH-10200)
https://github.com/python/cpython/commit/c61e229d2a4c54ffb4153e1f0f48126ba33c9cbf


--

___
Python tracker 

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



[issue35085] FileNotFoundError: [Errno 2] No such file or directory:

2018-10-28 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
resolution:  -> not a bug
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



[issue35084] binascii.Error: Incorrect padding

2018-10-28 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Can you please add your definition of a crash? Crash in bug report context is 
used in C language context like causing a segfault, buffer overflow etc. Proper 
Exceptions are not considered as a crash and this is an exception raised since 
the contents are invalid. If it crashes as I mentioned above can you please add 
the crash log?

--

___
Python tracker 

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



[issue35096] Change _PY_VERSION to derive from sys.version_info in sysconfig

2018-10-28 Thread Ned Deily


Ned Deily  added the comment:

This has come up before, see Issue25985 and Issue24916 (still open).  Let's 
call this a duplicate of the latter and continue any discussion there.

--
nosy: +ned.deily
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> In sysconfig, don't rely on sys.version format

___
Python tracker 

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



[issue35086] tkinter docs: errors in A Simple Hello World Program

2018-10-28 Thread Daniel Lovell


Daniel Lovell  added the comment:

Thanks for the reply xtreak. I agree that changing the example to include 
main() isn't necessary - I unintentionally included that from my example of the 
case where the current version isn't functional. 

In the PR I submitted on Github (https://github.com/python/cpython/pull/10160), 
the proposed change is simply adding the master Tk instance to self.master then 
using that to close the window in the Quit button callback.

Sorry for the confusion.

--

___
Python tracker 

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



[issue35054] Add more index entries for symbols

2018-10-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 913876d824d969f8c7431e8a9d4610a9a11a786e by Serhiy Storchaka in 
branch 'master':
bpo-35054: Add yet more index entries for symbols. (GH-10121)
https://github.com/python/cpython/commit/913876d824d969f8c7431e8a9d4610a9a11a786e


--

___
Python tracker 

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



[issue35091] Objects/listobject.c: gallop functions rely on signed integer overflow

2018-10-28 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


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

___
Python tracker 

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



[issue35064] COUNT_ALLOCS build export inc_count() and dec_count() functions which don't have a "Py_" prefix

2018-10-28 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
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



[issue23828] test_socket testCmsgTruncLen0 gets "received malformed or improperly-truncated ancillary data" warning under OS X

2018-10-28 Thread Ned Deily


Ned Deily  added the comment:

Duplicate Issue35092 notes that running the tests with -Werror turns these 
warnings into test failures.

--
components: +macOS
nosy: +ronaldoussoren
versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue35092] test_socket fails in MacOS High Sierra when running with -Werror

2018-10-28 Thread Ned Deily


Ned Deily  added the comment:

This is a longstanding minor issue as described in Issue23828. A twist here is 
that running with -Werror causes a test failure where normally there is just a 
warning.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> test_socket testCmsgTruncLen0 gets "received malformed or 
improperly-truncated ancillary data" warning under OS X

___
Python tracker 

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



[issue35089] Remove typing.io and typing.re from documentation

2018-10-28 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:


New changeset c8a8d6b347d5a6899feb7c810d28f22f3cb151b8 by Ivan Levkivskyi 
(Sebastian Rittau) in branch 'master':
bpo-35089: Don't mention typing.io and typing.re (GH-10173)
https://github.com/python/cpython/commit/c8a8d6b347d5a6899feb7c810d28f22f3cb151b8


--

___
Python tracker 

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



[issue35089] Remove typing.io and typing.re from documentation

2018-10-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9500

___
Python tracker 

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



[issue35089] Remove typing.io and typing.re from documentation

2018-10-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9501

___
Python tracker 

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



[issue35090] bz2: Potential division by zero in BZ2_Malloc()

2018-10-28 Thread STINNER Victor


STINNER Victor  added the comment:

> May be we should add a new function (_PyMem_RawMallocItems?) that does the 
> same checks as PyMem_RawCalloc, but doesn't zero-initialize memory?

Please don't add new functions to the Python memory allocators. We already have 
too many of them :-(
https://docs.python.org/dev/c-api/memory.html

PyZlib_Malloc, PyLzma_Malloc and BZ2_Malloc exists because they use different 
types: 2 unsigned int (zlib), 2 size_t (lzma), 2 int (bz2). PyMem_RawMalloc() 
expects a single size_t.

IMHO it's fine to have a function of 5 lines of code in each module, since each 
module uses a different C type.

--

___
Python tracker 

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



[issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self"

2018-10-28 Thread STINNER Victor


STINNER Victor  added the comment:

The cast warning is not specific to this issue, it's a more general issue that 
will be address in bpo-33012. I close again  the bug.

--
status: open -> closed

___
Python tracker 

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



[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2018-10-28 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue34931] os.path.splitext with more dots

2018-10-28 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

IMHO this is not a bug. Every file starting with a dot is hidden by default, so 
this is somewhat correct behaviour. Since it is documented correctly I don't 
this something needs to change here.

Yet again, could someone more experienced offer their opinion as well?

--
nosy: +lys.nikolaou

___
Python tracker 

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



[issue1154351] add get_current_dir_name() to os module

2018-10-28 Thread Marc Adam Anderson


Change by Marc Adam Anderson :


--
nosy:  -marcadam

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2018-10-28 Thread STINNER Victor


STINNER Victor  added the comment:

Nice enhancement! I was always annoyed by XML libraries in PHP and Python which 
don't respect the "insertion order".

--
nosy: +vstinner

___
Python tracker 

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



[issue35094] Improved algorithms for random.sample

2018-10-28 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +mark.dickinson, rhettinger

___
Python tracker 

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



[issue35047] Better error messages in unittest.mock

2018-10-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 47d94241a383e2b8a2c40e81d12d40d5947fb170 by Victor Stinner 
(Petter Strandmark) in branch 'master':
bpo-35047, unittest.mock: Better error messages on assert_called_xxx failures 
(GH-10090)
https://github.com/python/cpython/commit/47d94241a383e2b8a2c40e81d12d40d5947fb170


--
nosy: +vstinner

___
Python tracker 

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



[issue33234] Improve list() pre-sizing for inputs with known lengths

2018-10-28 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +9518

___
Python tracker 

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



[issue35075] Doc: pprint example uses dead URL

2018-10-28 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue1154351] add get_current_dir_name() to os module

2018-10-28 Thread Braden Groom


Braden Groom  added the comment:

Victor, FWIW I don't need this functionality and your suggestion on the PR 
seems reasonable to me. I only picked up this issue as a way to become familiar 
with contributing to the project. I'm okay with closing both the PR and the 
ticket.

--
nosy: +bradengroom

___
Python tracker 

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



[issue25219] Update doc for Idle command line options.

2018-10-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I should have said what mismatch there might be.  It appears that further 
editing of idle.rst depends on checking whether there are errors in 
pyshell.usage_msg, which should be fixed first.

--
versions: +Python 3.7, Python 3.8 -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2018-10-28 Thread Mark Harfouche


Mark Harfouche  added the comment:

Right, but when do you actually use the bare python interpreter? I'm always
on ipython or something that uses that as the backend.

On Sun, Oct 28, 2018 at 4:12 PM Romain Geissler 
wrote:

>
> Romain Geissler  added the comment:
>
> Yes in my case the build works, but then I have a resulting python
> interpreter with limited readline functionality. That's why I have some
> interest in having this patch rebased and included into trunk.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue17514] Add the license to argparse.py

2018-10-28 Thread Braden Groom


Braden Groom  added the comment:

It seems like this can be closed unless we want to remove the current header in 
argparse.py.

--
nosy: +bradengroom

___
Python tracker 

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



[issue35097] IDLE add doc subsection for editor windows

2018-10-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9526

___
Python tracker 

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



[issue35097] IDLE add doc subsection for editor windows

2018-10-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset ea9c8bd44365ae8b0accc5286c7b52862528c0ec by Terry Jan Reedy in 
branch 'master':
bpo-35097: Add IDLE doc subsection explaining editor windows. (#10206)
https://github.com/python/cpython/commit/ea9c8bd44365ae8b0accc5286c7b52862528c0ec


--

___
Python tracker 

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



[issue35097] IDLE add doc subsection for editor windows

2018-10-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9525

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2018-10-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset e3685fd5fdd8808acda81bfc12fb9702d4b59a60 by Raymond Hettinger in 
branch 'master':
bpo-34160: Preserve user specified order of Element attributes (GH-10163)
https://github.com/python/cpython/commit/e3685fd5fdd8808acda81bfc12fb9702d4b59a60


--

___
Python tracker 

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



[issue35093] IDLE: document the help document viewer

2018-10-28 Thread Terry J. Reedy


New submission from Terry J. Reedy :

Implement issue 33396 item 6: document the IDLE Doc viewer.

--
assignee: docs@python
components: Documentation, IDLE
messages: 328725
nosy: docs@python, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: document the help document viewer
type: enhancement
versions: Python 3.6, 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



[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2018-10-28 Thread Mark Harfouche


Mark Harfouche  added the comment:

My workaround has been to use neither readline nor libedit.

On Sun, Oct 28, 2018 at 2:40 PM Romain Geissler 
wrote:

>
> Romain Geissler  added the comment:
>
> Hi,
>
> Yes this bug report is still valid. I just tried compiling Python 3.7.1 on
> linux with libedit installed (https://thrysoee.dk/editline/) but not
> libreadline, and indeed the configure script fails to detect I have it
> installed and falls back on the python readline emulation.
>
> Note: I am using Linux, not Mac OS.
>
> Cheers,
> Romain
>
> --
> nosy: +RomainGeissler1A
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue35093] IDLE: document the help document viewer

2018-10-28 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
assignee: docs@python -> terry.reedy
components:  -Documentation

___
Python tracker 

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



[issue22021] shutil.make_archive() root_dir do not work

2018-10-28 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
pull_requests: +9509
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



[issue35090] Potential division by zero and integer overflow in allocator wrappers

2018-10-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think it is worth to backport. Perhaps it is possible even to create a 
reproducer for integer overflow, but I afraid it will be too slow for using in 
tests.

--

___
Python tracker 

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



[issue35094] Improved algorithms for random.sample

2018-10-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Sorry, this has been discussed and rejected multiple times.  Reservoir sampling 
makes far too many calls to the underlying random number generator.

--
assignee:  -> rhettinger
resolution:  -> rejected
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



[issue35091] Objects/listobject.c: gallop functions rely on signed integer overflow

2018-10-28 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> tim.peters
nosy: +tim.peters

___
Python tracker 

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



[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2018-10-28 Thread Romain Geissler


Romain Geissler  added the comment:

Yes in my case the build works, but then I have a resulting python interpreter 
with limited readline functionality. That's why I have some interest in having 
this patch rebased and included into trunk.

--

___
Python tracker 

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



[issue33234] Improve list() pre-sizing for inputs with known lengths

2018-10-28 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-33234 Improve list() pre-sizing for inputs with known lengths (GH-9846)

Oh. Can you please document the optimization in the following doc as well?
https://docs.python.org/dev/whatsnew/3.8.html#optimizations

--

___
Python tracker 

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



[issue33396] IDLE: Improve and document help doc viewer

2018-10-28 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
dependencies: +IDLE: document the help document viewer -Checking for 
abstractmethod implementation fails to consider MRO for builtins

___
Python tracker 

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



[issue33396] IDLE: Improve and document help doc viewer

2018-10-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#35093 implements item 6, (initially) doc the help viewer.  When we improve the 
help viewer, we should revise the doc at the same time.
(I unlinked comment with wrong issue number.)

--

___
Python tracker 

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



[issue33396] IDLE: Improve and document help doc viewer

2018-10-28 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
Removed message: https://bugs.python.org/msg328739

___
Python tracker 

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



[issue35094] Improved algorithms for random.sample

2018-10-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

One other thought.  We don't guarantee that sample() will always produce the 
same sequences, so that does give us some freedom; however, we have a strong 
aversion to doing so unless there is a compelling advantage.  It will almost 
certainly cause some disruption for users if their samples stop being 
reproducible from a given seed.  There is some value to the implementation 
remaining stable.

--

___
Python tracker 

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



[issue32804] urllib.retrieve documentation doesn't mention context parameter

2018-10-28 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


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

___
Python tracker 

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



[issue35094] Improved algorithms for random.sample

2018-10-28 Thread Paul Crowley


Paul Crowley  added the comment:

Thank you for a very comprehensive and helpful answer!

Yep, reservoir sampling makes n calls not k calls, and so should only be used 
when k is a large fraction of n; in my patch it's k/n >= 1/2.

Because modern CPRNGs are so fast, I had been assuming that overall runtime, 
rather than calls to the RNG; I'll have to bear that in mind here, though in 
general "use a secure seed to whatever secure RNG is fastest" is the right 
strategy.

I don't think hedging against the quality of the RNG is the right thing to do 
here.

I don't mean to suggest you didn't think about this problem hard! It's just 
that I've been obsessing about this problem for the last few weeks for some 
reason (see my repo) so I thought I might be able to help. Thanks again for you 
reply!

--

___
Python tracker 

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



[issue35084] binascii.Error: Incorrect padding

2018-10-28 Thread TestUser


TestUser  added the comment:

Thanks. The Python Foundation asked for users to report bugs. I've done so.

I'm looking at putting this in an article and Tweets on the bug process:
generating bugs, reporting, and resolution.

If I go forward I would like a thought or two from you on this bug process.

Thanks

On Sun, Oct 28, 2018, 5:41 PM Braden Groom  wrote:

>
> Braden Groom  added the comment:
>
> The file contents that you've provided aren't valid base64. I think the
> traceback that you've received is a reasonable one.
>
> --
> nosy: +bradengroom
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue30410] Documentation for sys.stdout encoding does not reflect the new Windows behavior in Python 3.6+

2018-10-28 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Shall I create a PR for this?

--
nosy: +lys.nikolaou

___
Python tracker 

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



[issue35097] IDLE add doc subsection for editor windows

2018-10-28 Thread Terry J. Reedy


New submission from Terry J. Reedy :

Briefly explain opening a file, running code, and the title and status bars.

--
assignee: terry.reedy
components: IDLE
messages: 328771
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE add doc subsection for editor windows
type: enhancement
versions: Python 3.6, 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



[issue24916] In sysconfig, don't rely on sys.version format

2018-10-28 Thread Ned Deily


Ned Deily  added the comment:

Noted in passing: while Lib/distutils/sysconfig.py has not implemented 
"py_version", I see now that Lib/distutils/command/install.py does have 
something very similar to Lib/sysconfig.py so whatever (if anything) is changed 
in one should also be changed in the other.

--

___
Python tracker 

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



[issue34794] Memory leak in Tkinter

2018-10-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset aaea2802da0a074c695ab86911d8bcc0b2dd5ec5 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-34794: Fix a leak in Tkinter. (GH-10025) (GH-10181)
https://github.com/python/cpython/commit/aaea2802da0a074c695ab86911d8bcc0b2dd5ec5


--

___
Python tracker 

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



[issue35054] Add more index entries for symbols

2018-10-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 5b2e1cfde28cce7f4b9275ec1b3757c561eef94e by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-35054: Add yet more index entries for symbols. (GH-10121). (GH-10182)
https://github.com/python/cpython/commit/5b2e1cfde28cce7f4b9275ec1b3757c561eef94e


--

___
Python tracker 

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



[issue34794] Memory leak in Tkinter

2018-10-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
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



[issue35093] IDLE: document the help document viewer

2018-10-28 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +9513
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



[issue35045] test_min_max_version (test.test_ssl.ContextTests) fails on Fedora 29+ and openssl 1.1.1

2018-10-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The OP for #35076 emailed me that the distribution is obarun, based on 
ArchLinux. with LibreSSL not officialy supported, but for the moment a personal 
work.

--

___
Python tracker 

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



[issue35096] Change _PY_VERSION to derive from sys.version_info in sysconfig

2018-10-28 Thread Lysandros Nikolaou


New submission from Lysandros Nikolaou :

In sysconfig.py there is a comment starting with FIXME that states that 
_PY_VERSION should get its value from sys.version_info instead of sys.version, 
because it is an implementation detail.

Should this be changed? If so, I would like to create a PR.

--
messages: 328769
nosy: lys.nikolaou
priority: normal
severity: normal
status: open
title: Change _PY_VERSION to derive from sys.version_info in sysconfig
versions: Python 3.8

___
Python tracker 

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



[issue35096] Change _PY_VERSION to derive from sys.version_info in sysconfig

2018-10-28 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +tarek

___
Python tracker 

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



[issue35097] IDLE add doc subsection for editor windows

2018-10-28 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +9524
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



[issue19376] document that strptime() does not support the Feb 29 if the format does not contain the year

2018-10-28 Thread Braden Groom


Braden Groom  added the comment:

> In other words, the documentation looks sufficient to me as-is, and adding 
> special wording for this would only make it longer than it should be.

I agree with Victor here. It seems like this can be closed. There haven't been 
any comments from other people hitting this issue for 5 years.

--
nosy: +bradengroom

___
Python tracker 

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



[issue1154351] add get_current_dir_name() to os module

2018-10-28 Thread Anthony Sottile


Anthony Sottile  added the comment:

Does this actually make sense for the `os` module? `PWD` is a variable set by 
your interactive shell and doesn't really make sense outside that context.

I expect this function to be too easily confused with `os.getcwd()` and a 
source of bugs when the latter is desired

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue14956] custom PYTHONPATH may break apps embedding Python

2018-10-28 Thread Romain Geissler


Romain Geissler  added the comment:

Hi,

Just updating this 6 year old bug report. The last comment says it's not 
possible to ignore environment when using the C-API. I don't know back then, 
but today it is possible. I have just built gdb 8.2 against python 3.7.1, and 
patched gdb with this simple patch, which apparently works:

--- gdb/python/python.c
+++ gdb/python/python.c
@@ -1726,6 +1726,9 @@
 #endif
 #endif

+  // Force using the toolchain python without being troubled by $PYTHONHOME or 
$PYTHONPATH.
+  Py_IgnoreEnvironmentFlag = 1;
+
   Py_Initialize ();
   PyEval_InitThreads ();

Cheers,
Romain

--
nosy: +RomainGeissler1A

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2018-10-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9508

___
Python tracker 

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



[issue35094] Improved algorithms for random.sample

2018-10-28 Thread Paul Crowley


Change by Paul Crowley :


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

___
Python tracker 

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



[issue35084] binascii.Error: Incorrect padding

2018-10-28 Thread TestUser


TestUser  added the comment:

The file contained the following code:
0x11a3ff119c\xe3\x50\x89\xe2\x53\x89\xe1\xb0\x0b\xcd\x80#%^ciuqrfiqrYWJjMTIzIT8kKiYoKSctPUB-
abc123!

On Sun, Oct 28, 2018 at 1:35 AM Karthikeyan Singaravelan <
rep...@bugs.python.org> wrote:

>
> Karthikeyan Singaravelan  added the comment:
>
> Thanks for the report. Can you please attach the file test.code1? Your
> original report says "test.code1" is not base64 encoded and -d takes a file
> that is base64 encoded and decodes it. Can you please be more descriptive
> about what you are expecting?
>
> --
> nosy: +xtreak
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue35093] IDLE: document the help document viewer

2018-10-28 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
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



[issue35090] Potential division by zero and integer overflow in allocator wrappers

2018-10-28 Thread miss-islington


miss-islington  added the comment:


New changeset 1d7d165e3c3f07518e6b5bfb57f1fd460cd4bbf2 by Miss Islington (bot) 
in branch '3.7':
bpo-35090: Fix potential division by zero in allocator wrappers (GH-10174)
https://github.com/python/cpython/commit/1d7d165e3c3f07518e6b5bfb57f1fd460cd4bbf2


--
nosy: +miss-islington

___
Python tracker 

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



[issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions

2018-10-28 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

On Fri, Oct 26, 2018, at 03:18, STINNER Victor wrote:
> 
> STINNER Victor  added the comment:
> 
> Benjamin:
> > Why do we need this Py_STATIC_INLINE macro? If you want to have one for 
> > enabling always inline, that's fine with me, since it's compiler-specific.
> 
> For about the name, there is already Py_LOCAL_INLINE which also uses 
> "static inline", but has a very different usage: "Py_LOCAL can be used 
> instead of static to get the fastest possible calling convention for 
> functions that are local to a given module." So I chise 
> "Py_STATIC_INLINE" name, it describes the basic implementation ("static 
> inline TYPE").

I would like to see Py_LOCAL_INLINE removed, too, fwiw.

> 
> Py_STATIC_INLINE() is designed to replace a preprocessor macro with a 
> function, when you care that the code is "always inlined". (Maybe the 
> name is not perfect ;-))

"always inline" is different from "static inline". So, it's not appropriate to 
make a macro named the latter that has the former former.

> 
> Honestly, I'm not sure that it really matters that the function is 
> "always" inlined. The main issue is that "static" requires to duplicate 
> the function in each file which uses the macro, when the function 
> cannot/is not inlined.
> 
> 
> Previously, you asked me:
> 
> > Does this slow down debug builds at all? It probably will not end will if 
> > Py_INCREF is ever not inlined.
> 
> That's why I wrote Py_STATIC_INLINE() to "force" inlining and PR 10094 
> to enable inlining for Debug build on MSVC.
> 
> 
> > But the current Py_STATIC_INLINE macro seems to conflate linkage with 
> > always-inline behavior.
> 
> I'm not sure that I get it. Do you talk about "static" inside the macro? 
> bpo-33407 modifies Py_DEPRECATED() to support Visual Stuido, but it 
> requires to modify how the macro is used: it now must be used at the 
> start, rather than at the end:
> https://github.com/python/cpython/pull/8980/files
> 
> I chose to put "static" and "inline" in the same macro. We already have 
> many other similar macros like PyAPI_FUNC(TYPE) and Py_LOCAL(TYPE). I 
> would like to have a common way to "declare a function behaving as a 
> macro".

We don't want functions that behave like macros... otherwise, we would be 
writing macros. If we want a function to always be inlined, we should 
explicitly request that from the compiler.

> 
> 
> Please see also the discussion on the PR itself, Neil discuss what's the 
> best way to declare an inline function:
> https://github.com/python/cpython/pull/10079#issuecomment-433230587
> 
> By the way, was it you who required "static inline" support in PEP 7? :-)

Yes, which is why we shouldn't need a macro to write it.

--

___
Python tracker 

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



[issue35094] Improved algorithms for random.sample

2018-10-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

For the common case, where k is small and n is large, reservoir sampling makes 
n calls rather the current k plus a few reselections -- the only cost is a 
temporary k-sized set using superfast int hashing.  This technique works even 
for a very large values of n, such as sample(range(1_000_000_000), k=10_000).

For the case where k is a large percentage of n, the size of the set becomes 
noticeable and reselections would become more common (placing a higher load on 
the underlying RNG and eating its entropy, keep in mind that the underlying RNG 
can be SystemRandom for example).  So, we switch algorithms to a partial 
shuffle, which has no reselections and uses a temporary list of references to 
the sampled objects.   The places the absolute minimum burden on the underlying 
RNG and makes the minimum number of data swaps (neither of those virtues can be 
claimed by reservoir sampling).

The only advantage of the reservoir approach is not requiring auxiliary
storage.  Keep in mind, the temporary list only holds references to the sampled 
data, so tends to be small relative to that data.  It is no more 
disadvantageous than typical applications of list comprehensions which make new 
lists while looping over some other iterable.

In any case, the algorithms prefer to optimize for fewest calls the the random 
number generator rather than aspiring to zero auxiliary storage.  The 
randbelow() calls are not superfast, so we don't want to use many of them.  
Likewise, calls to SystemRandom() eat available entropy,  so we don't want to 
use many of them either.  Also, the Random class is designed to be subclassed 
to allow uses of other RNGs which are likely to have a smaller period that the 
MersenneTwister so we don't want many calls to them either (it eats their 
limited state space just like shuffle() exceeds the capabilities of MT with an 
input size as small as 2081).

Lastly, I have a vaguely held concern that reservoir sampling uses the RNG in a 
way that would magnify any weaknesses in that RNG (by virtues to making more 
calls and by virtue of using selections in the full range from n-k to n), so we 
would get lower quality shuffles.

FWIW, all of these things were considered when shuffle() was designed, it 
wasn't like other methods weren't considered.  The design we have now was 
deemed to be the best fit for most of our users, most of time (we've never 
gotten a complaint about the temporary storage being a problem for any user, 
ever).  I would however expect complaints about an increased number of calls to 
the user's rngs.

--

___
Python tracker 

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



[issue35091] Objects/listobject.c: gallop functions rely on signed integer overflow

2018-10-28 Thread Tim Peters


Tim Peters  added the comment:

This doesn't actually matter - the code can never trigger.  It would be fine to 
replace it with an assert to that effect (see below for a specific suggestion).

The reason:  The indices in this code are into vectors of PyObject*.  These 
vectors can't contain more than

floor(PY_SSIZE_T_MAX / sizeof(PyObject*))

pointers (see listobject.c & Python's heap allocation routines).  So the 
largest legit index this code can ever see is 1 less than that.  Since pointers 
are at least 4 bytes on all machines Python runs on, that implies (with room to 
spare) that

assert(ofs <= (PY_SSIZE_T_MAX - 1) / 2);

can't fail.  Which in turn implies that, mathematically,

2*ofs + 1 <= PY_SSIZE_T_MAX

So

   if (ofs <= 0)   /* int overflow */

can't happen, regardless of how the platform C treats signed overflow (signed 
overflow can't happen to begin with).  The existing `while (ofs < maxofs)` 
check already ensures that `ofs` is a legit index, and _any_ legit index into a 
PyObject* vector can be doubled and incremented without overflowing Py_ssize_t.

In fact, that would remain so even if listobject.c allowed its PyObject* 
vectors to contain twice as many pointers as they actually can contain now.

--

___
Python tracker 

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



[issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions

2018-10-28 Thread STINNER Victor


STINNER Victor  added the comment:

>> Py_STATIC_INLINE() is designed to replace a preprocessor macro with a 
>> function, when you care that the code is "always inlined". (Maybe the 
>> name is not perfect ;-))
>
> "always inline" is different from "static inline". So, it's not appropriate 
> to make a macro named the latter that has the former former.

Oh ok. So if we decide to keep it, it should be renamed to 
Py_STATIC_ALMOST_ALWAYS_INLINE() or something like that :-)


> We don't want functions that behave like macros... otherwise, we would be 
> writing macros. If we want a function to always be inlined, we should 
> explicitly request that from the compiler.

Oh. It seems like I misunderstood you.

I understood that you required to have zero impact on performance on debug 
build.

*I* want to use functions because it's the regular C language: regular scope 
rules, no preprocessor magic, the compiler detects errors if the function is 
misused, etc.

But I'm not sure about the drawbacks of converting a macro to a function. I 
don't want to be the only one responsible to regressions :-) If you support the 
change, we can drop "__attribute__((always_inline))" and use "regular" "static 
inline" functions :-)


>> By the way, was it you who required "static inline" support in PEP 7? :-)
>
> Yes, which is why we shouldn't need a macro to write it.

Ok ok.

I updated my PR 10079 to simply use "static inline".

--

___
Python tracker 

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



[issue35084] binascii.Error: Incorrect padding

2018-10-28 Thread Braden Groom


Braden Groom  added the comment:

The file contents that you've provided aren't valid base64. I think the 
traceback that you've received is a reasonable one.

--
nosy: +bradengroom

___
Python tracker 

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



[issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions

2018-10-28 Thread STINNER Victor


STINNER Victor  added the comment:

If my PR 10079 is merged without Py_STATIC_INLINE(), I will remove the macro.

I'm not sure if we need an "always inline" macro or not.

Note: I'm in favor of moving closer to the C language and not abusing 
__attribute__(...) :-)

--

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2018-10-28 Thread Diego Rojas


Diego Rojas  added the comment:

Raymond, sure. I could do the rest, I'll start tomorrow Monday.

--

___
Python tracker 

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



[issue35091] Objects/listobject.c: gallop functions rely on signed integer overflow

2018-10-28 Thread Tim Peters


Tim Peters  added the comment:

I left the code in because it was harmless (a 100%-predictable branch), and it 
was easier to show that overflow was _considered_ than to explain in full why 
it was impossible.  In the context of CPython.  For example, the Java port of 
this code couldn't rely on the far-removed-from-this-code details of Python's C 
heap management (the largest Java signed integer is a legit Java array index), 
and signed integer overflow _is_ wholly defined in Java.  Which happens to be 
the same way it worked under virtually all C compilers at the time the code was 
written.  The idea that C compilers should be as aggressive as Fortran 
compilers instead of just supplying a portable assembly language is a modern 
conceit ;-)

The code is useless, but it's not "a bug", so I'm removing Python 2 from the 
list of targets.

--
versions:  -Python 2.7

___
Python tracker 

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



[issue35098] Deleting __new__ does not restore previous behavior

2018-10-28 Thread Joy Diamond


New submission from Joy Diamond :

Related: https://bugs.python.org/issue5322

Consider the following program:

class Color(object):
__slots__ = (('name',))

def __init__(self, name):
self.name = name

green = Color('green')  #   Works
assert green.name == 'green'

Color.__new__ = 0
del Color.__new__

red = Color('red')  #   Fails in Python 3; works in Python 2 & pypy
assert red.name == 'red'

This works in Python 2, pypy, but fails in Python 3 as follows:

Traceback (most recent call last):
  File "x.py", line 13, in 
red = Color('red')  #   Fails in Python 3; works in Python 2 & pypy
TypeError: object() takes no parameters

--
messages: 328773
nosy: joydiamond
priority: normal
severity: normal
status: open
title: Deleting __new__ does not restore previous behavior
versions: Python 3.5, Python 3.7

___
Python tracker 

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



[issue1154351] add get_current_dir_name() to os module

2018-10-28 Thread Michael Hoffman


Michael Hoffman  added the comment:

glibc `getcwd()` and `get_current_dir_name()` are not the same. glibc
`get_current_dir_name()` does, in fact, check the `PWD` environment
variable.

https://www.gnu.org/software/libc/manual/html_node/Working-Directory.html

The get_current_dir_name function is basically equivalent to
getcwd (NULL, 0), except the value of the PWD environment variable is first
examined, and if it does in fact correspond to the current directory, that
value is returned. This is a subtle difference which is visible if the path
described by the value in PWD is using one or more symbolic links, in which
case the value returned by getcwd would resolve the symbolic links and
therefore yield a different result.

On Sun, Oct 28, 2018 at 5:27 PM Braden Groom report-at-bugs.python.org
|Python/Example Allow| <16snny1crx82...@sneakemail.com> wrote:

>
> Braden Groom  added the comment:
>
> Victor, FWIW I don't need this functionality and your suggestion on the PR
> seems reasonable to me. I only picked up this issue as a way to become
> familiar with contributing to the project. I'm okay with closing both the
> PR and the ticket.
>
> --
> nosy: +bradengroom
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue1154351] add get_current_dir_name() to os module

2018-10-28 Thread STINNER Victor


STINNER Victor  added the comment:

The glibc has a get_current_dir_name() function which returns the same value 
that getcwd(), the difference is that get_current_dir_name() allocates memory. 
If someone wants to add a function using PWD env var, a different function name 
should be found.

--
nosy: +vstinner

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2018-10-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Diego, I've taken care of the ElementTree case.  Would you like to make a PR 
for the other occurrences (minidom, html, etc)?

--

___
Python tracker 

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



[issue35095] Implement pathlib.Path.append_bytes and pathlib.Path.append_text

2018-10-28 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

Right now we have:

Path.read_bytes
Path.read_text
Path.write_bytes
Path.write_text

as opening the file, appending something and closing the file is also a very 
typical operation to do it would be nice to have:

Path.append_bytes
Path.append_text

--
components: Library (Lib)
messages: 328730
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Implement pathlib.Path.append_bytes and pathlib.Path.append_text
versions: Python 3.8

___
Python tracker 

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



[issue35095] Implement pathlib.Path.append_bytes and pathlib.Path.append_text

2018-10-28 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue35084] binascii.Error: Incorrect padding

2018-10-28 Thread TestUser


TestUser  added the comment:

FYI: This error generates an Ubuntu Crash Report. Every time I use it on
the CLI. I wonder how many of these are generated?

On Sun, Oct 28, 2018 at 3:49 PM TestUser  wrote:

>
> TestUser  added the comment:
>
> The file contained the following code:
>
> 0x11a3ff119c\xe3\x50\x89\xe2\x53\x89\xe1\xb0\x0b\xcd\x80#%^ciuqrfiqrYWJjMTIzIT8kKiYoKSctPUB-
> abc123!
>
> On Sun, Oct 28, 2018 at 1:35 AM Karthikeyan Singaravelan <
> rep...@bugs.python.org> wrote:
>
> >
> > Karthikeyan Singaravelan  added the comment:
> >
> > Thanks for the report. Can you please attach the file test.code1? Your
> > original report says "test.code1" is not base64 encoded and -d takes a
> file
> > that is base64 encoded and decodes it. Can you please be more descriptive
> > about what you are expecting?
> >
> > --
> > nosy: +xtreak
> >
> > ___
> > Python tracker 
> > 
> > ___
> >
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue35094] Improved algorithms for random.sample

2018-10-28 Thread Paul Crowley


Paul Crowley  added the comment:

I would be very grateful for your help finding those dicussions! I've tried 
this search:

https://www.google.com/search?q=python+%22Reservoir+sampling%22+rhettinger

and found this discussion:

https://mail.python.org/pipermail/python-ideas/2016-April/039708.html

but if I've missed any I'm keen to know.

In my pull request reservoir sampling is only used if 2k>=n, so it makes at 
most twice as many random requests as any other algorithm.

--

___
Python tracker 

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



[issue33234] Improve list() pre-sizing for inputs with known lengths

2018-10-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 372d705d958964289d762953d0a61622755f5386 by Pablo Galindo in 
branch 'master':
bpo-33234 Improve list() pre-sizing for inputs with known lengths (GH-9846)
https://github.com/python/cpython/commit/372d705d958964289d762953d0a61622755f5386


--

___
Python tracker 

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



[issue35090] Potential division by zero and integer overflow in allocator wrappers

2018-10-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9515

___
Python tracker 

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



[issue35093] IDLE: document the help document viewer

2018-10-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9517

___
Python tracker 

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



[issue35090] Potential division by zero and integer overflow in allocator wrappers

2018-10-28 Thread STINNER Victor


STINNER Victor  added the comment:

Serhiy: "I think it is worth to backport."

Ok. I asked the bot to create 3.6 and 3.7 backports, and I just approved them.

I checked: Python 2.7 is not affected.

--
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



[issue35093] IDLE: document the help document viewer

2018-10-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9516

___
Python tracker 

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



[issue33234] Improve list() pre-sizing for inputs with known lengths

2018-10-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>Oh. Can you please document the optimization in the following doc as well?

Sure! Opened https://github.com/python/cpython/pull/10200 to address that. :)

--

___
Python tracker 

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



[issue35090] Potential division by zero and integer overflow in allocator wrappers

2018-10-28 Thread miss-islington


miss-islington  added the comment:


New changeset fd0a3bce6e917b5853c809a309c1513acc176f56 by Miss Islington (bot) 
in branch '3.6':
bpo-35090: Fix potential division by zero in allocator wrappers (GH-10174)
https://github.com/python/cpython/commit/fd0a3bce6e917b5853c809a309c1513acc176f56


--

___
Python tracker 

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



[issue35045] test_min_max_version (test.test_ssl.ContextTests) fails on Fedora 29+ and openssl 1.1.1

2018-10-28 Thread Christian Heimes


Christian Heimes  added the comment:

By the way LibreSSL isn't offically supported by Python, either. It just 
happens to work most of the time. I regard LibreSSL as not supported, because 
no core developer or regular contributor has shown any interest to work on 
LibreSSL support. OpenSSL is used on almost all platforms (most Linux distros, 
Windows, macOS, FreeBSD) any way.

--

___
Python tracker 

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



[issue35090] Potential division by zero and integer overflow in allocator wrappers

2018-10-28 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, now we should be good :-) I close again the issue.

Note: Serhiy Stochaka considers that no NEWS entry is needed and I concur with 
him.

--
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



  1   2   >