[issue30693] tarfile add uses random order

2018-02-06 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5388

___
Python tracker 

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



[issue30693] tarfile add uses random order

2018-02-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 2c6f6682768f401c297c584ef106d48c78697f67 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.7':
bpo-30693: Fix tarfile test cleanup on MSWindows (GH-5557) (GH-5567)
https://github.com/python/cpython/commit/2c6f6682768f401c297c584ef106d48c78697f67


--

___
Python tracker 

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



[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Oh, my mistake. I thought the case when args is a string and shell=False is 
deprecated.

--

___
Python tracker 

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



[issue30693] tarfile add uses random order

2018-02-06 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



[issue32782] ctypes: memoryview gives incorrect PEP3118 itemsize for array of length zero

2018-02-06 Thread Eric Wieser

New submission from Eric Wieser :

Take the following simple structure:

class Foo(ctypes.Structure):
_fields_ = [('f', ctypes.uint32_t)]

And construct some arrays with it:

def get_array_view(N):
return memoryview((Foo * N)())

In most cases, this works as expected, returning the size of one item:

>>> get_array_view(10).itemsize
4
>>> get_array_view(1).itemsize
4

But when N=0, it returns the wrong result

>>> get_array_view(0).itemsize
0

Which contradicts its `.format`, which still describes a 4-byte struct

>>> get_array_view(0).format
'T{>I:one:}'

This causes a downstream problem in numpy:

>>> np.array(get_array_view(0))
RuntimeWarning: Item size computed from the PEP 3118 buffer format string 
does not match the actual item size.

--
components: ctypes
messages: 311740
nosy: Eric.Wieser
priority: normal
severity: normal
status: open
title: ctypes: memoryview gives incorrect PEP3118 itemsize for array of length 
zero
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-06 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

Nathaniel's specific description of a problem is wrong.  A Path with embedded 
spaces is treated no different than one without by default.

Where things change, and what needs fixing, is when shell=True is passed. In 
that case a PathLike object should not be allowed as it will be turned into a 
flat string passed to the shell for parsing.

# I've created an executable bash script called "x/mybin -h" for this that just 
does: echo "hello from mybin $*"

>>> run("x/mybin -h", shell=True)
/bin/sh: 1: x/mybin: not found
CompletedProcess(args='x/mybin -h', returncode=127)
>>> run("x/mybin -h")
hello from mybin 
CompletedProcess(args='x/mybin -h', returncode=0)
>>> run(Path("x/mybin -h"), shell=True)
/bin/sh: 1: x/mybin: not found
CompletedProcess(args=PosixPath('x/mybin -h'), returncode=127)
>>> run([Path("x/mybin -h")], shell=True)
/bin/sh: 1: x/mybin: not found
CompletedProcess(args=[PosixPath('x/mybin -h')], returncode=127)
>>> run(Path("x/mybin -h"))
hello from mybin 
CompletedProcess(args=PosixPath('x/mybin -h'), returncode=0)
>>> run([Path("x/mybin -h")])
hello from mybin

--
priority: release blocker -> deferred blocker

___
Python tracker 

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



[issue6766] Cannot modify dictionaries inside dictionaries using Managers from multiprocessing

2018-02-06 Thread Snidhi Sofpro

Snidhi Sofpro  added the comment:

Hi team,

Looks like this issue remains per code below:

import multiprocessing, sys, time, traceback;

if __name__ == '__main__':

print(sys.version);

mpd = multiprocessing.Manager().dict();
mpd['prcss'] = {'q' : 'queue_1', 'ctlg' : 'ctlg_1' };

# update 1 - doesn't work!
mpd['prcss'].update( { 'name': 'concfun_1'} );
print('Result of failed update 1:', mpd['prcss']);

# update 2 - doesn't work!
mpd['prcss']['name'] = 'concfun_1';
print('Result of failed update 2:', mpd['prcss']);

# update 3 - works!
mpd_prcss = mpd['prcss'];
mpd_prcss['name'] = 'concfun_1';
mpd['prcss'] = mpd_prcss;
print('Result of successful update 3:', mpd['prcss']);

### --- output ###
3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)]
Result of failed update 1: {'q': 'queue_1', 'ctlg': 'ctlg_1'}
Result of failed update 2: {'q': 'queue_1', 'ctlg': 'ctlg_1'}
Result of successful update 3: {'q': 'queue_1', 'ctlg': 'ctlg_1', 'name': 
'concfun_1'}

--
nosy: +Snidhi
versions:  -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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-06 Thread Ned Deily

Ned Deily  added the comment:

> Ned Deily, what do you think about?

I would like to have Steve's opinion.

--

___
Python tracker 

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



[issue32368] Segfault when compiling many conditional expressions

2018-02-06 Thread Stefan Nordhausen

Stefan Nordhausen  added the comment:

The fix for https://bugs.python.org/issue31113 also fixed this issue.

--
resolution:  -> duplicate
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



[issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs)

2018-02-06 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Hmm, I don't see an easy way to fix it.
awaiting for cancelled task potentially can wait forever.
Adding another timeout looks too confusing.
Iterating over a couple of loop steps is not reliable: try/finally block in 
awaited task can perform async IO with unpredictable completion time.

--

___
Python tracker 

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



[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-06 Thread Anders Lorentsen

Anders Lorentsen  added the comment:

What do you mean "is a bug", and "the PR would encourage this"? Can't it be 
fixed?

Are you saying that just because it is a bug now, we should be discouraged from 
making it work in the way you'd expect it to work?

If `exe` is a path, these two lines of code should do exactly the same, right? 
It seems unintuitive to me if they produce different results.

run(exe)
run([exe])

--

___
Python tracker 

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



[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-06 Thread R. David Murray

R. David Murray  added the comment:

"I thought the case when args is a string and shell=False is deprecated."

IMO it ought to be :)  See issue 7839 for background.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue32773] distutils should NOT preserve timestamps

2018-02-06 Thread Jeroen Demeyer

Jeroen Demeyer  added the comment:

This is a bug report and not a feature request. I don't think that there should 
be an option. It should just do the right thing, which is NOT preserving 
timestamps.

--

___
Python tracker 

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



[issue30693] tarfile add uses random order

2018-02-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 4ad703b7ca463d1183539277dde90ffb1c808487 by Serhiy Storchaka 
(Bernhard M. Wiedemann) in branch 'master':
bpo-30693: Fix tarfile test cleanup on MSWindows (#5557)
https://github.com/python/cpython/commit/4ad703b7ca463d1183539277dde90ffb1c808487


--

___
Python tracker 

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



[issue32767] Mutating a list while iterating: clarify the docs

2018-02-06 Thread Stefan Pochmann

Stefan Pochmann  added the comment:

Yes, there's also `array.array`.

--
nosy: +Stefan Pochmann

___
Python tracker 

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



[issue32773] distutils should NOT preserve timestamps

2018-02-06 Thread R. David Murray

R. David Murray  added the comment:

That's the right thing in your opinion[*], but probably not in the opinion of 
others, thus the need for an option.  There is also backward compatibility to 
be considered.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-06 Thread INADA Naoki

INADA Naoki  added the comment:

Bad news: --enable-optimization doesn't solve it.
I hope same thing doesn't happen for Python 3.
Anyone tried Xcode 9.3?  What version of LLVM does Apple use?

Anyway, I think we need help of LLVM expert.

--

___
Python tracker 

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



[issue32781] lzh_tw is missing in locale.py

2018-02-06 Thread Po-Hsu Lin

Po-Hsu Lin  added the comment:

Yes, this is related to the language setting in Ubuntu, as the locale should be 
set to zh_TW instead of lzh_TW when the Timezone was set to Taipei.

But even so, I think this bug is still valid, as the lzh_TW does not exist in 
the lib at all.

--

___
Python tracker 

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



[issue32781] lzh_tw is missing in locale.py

2018-02-06 Thread INADA Naoki

INADA Naoki  added the comment:

> But even so, I think this bug is still valid, as the lzh_TW does not exist in 
> the lib at all.

Python doesn't have locale database, while have some aliases.
Python uses libc's locale.

This exception is raised because `_parse_localename` doesn't support
locale name without encoding.

In case of zh_TW, alias is registered:

'zh_tw':'zh_TW.big5',

But I don't think adding `lzh_tw` to alias is good idea.
There are no "one right alias table".  In case of zh_tw, you may
want zh_TW.UTF-8 rather than zh_TW.bit5, don't you?

So I think supporting locale name without encoding is right way.
Maybe, we should return None for encoding in such situation.

--

___
Python tracker 

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



[issue32647] Undefined references when compiling ctypes on binutils 2.29.1 with gcc -Wl, -z, undefs (Fedora 28)

2018-02-06 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

@Stephane,

Currently the flag has been disabled on rawhide due to too many breakages but 
the bug is still there if you add '-z defs' to the linker flags.

More info:
https://src.fedoraproject.org/rpms/redhat-rpm-config/c/8d6c6d0761089dfb7e1eacf35112b3d7a3f0d1af?branch=master

--

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-06 Thread Steve Dower

Steve Dower  added the comment:

In this case I like the flags disappearing on older versions, just as they 
would if you built CPython on a version of Linux that didn't have the flags. 
The problem is that the Windows SDK always defines enum values for all Windows 
versions even if you are targeting an older version, as most APIs silently 
ignore unknown flags. Since there's no way to reliably remove the flags at 
build time, it'll have to be done at import time.

In Python, existence normally implies availability, so we should maintain that 
here, especially since this API raises errors with these flags.

--

___
Python tracker 

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



[issue32773] distutils should NOT preserve timestamps

2018-02-06 Thread Jay Yin

Jay Yin  added the comment:

so what you're proposing, is that the function copy_file() itself, use 
defaults, but make it so that any functions that reference it not save the 
timing?, if so wouldn't that still require an internal option?

--

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-06 Thread Steve Dower

Steve Dower  added the comment:

Oh, and checking Windows version is hard. Better for us to get it right than 
every single library to risk getting it wrong. (The code used in the second PR 
is not right - there are IsWindowsVersion* macros that are better.)

--

___
Python tracker 

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



[issue32430] Simplify Modules/Setup{,.dist,.local}

2018-02-06 Thread Julien Palard

Julien Palard  added the comment:

Taking arguments into account, this solution may work:

- Continue to distribute a Setup.dist
- Add a configure option to change it, as Victor said --setup-file should do 
it, the default value should 
be Setup.dist
- Remove the `cp Setup.dist Setup`

This solution fixes the issue32429 as there is no longer a copy, it does not 
starts to track the Setup file so it should nor introduce any issue while 
switching to and from branches with this modification, and allow one to have 
multiple named configurations.

--

___
Python tracker 

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



[issue6135] subprocess seems to use local encoding and give no choice

2018-02-06 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5390

___
Python tracker 

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



[issue6135] subprocess seems to use local encoding and give no choice

2018-02-06 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset fc1ce810f1da593648b4d19e7d582a235ec1dd37 by Gregory P. Smith 
(Brice Gros) in branch 'master':
bpo-6135: Fix subprocess.check_output doc to mention changes in 3.6 (GH-5564)
https://github.com/python/cpython/commit/fc1ce810f1da593648b4d19e7d582a235ec1dd37


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



[issue32783] ln(2) isn't accurate in _math.c in cpython

2018-02-06 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

Thanks for the link to the Stackoverflow discussion. Currently there are three 
answers: two (correctly) answer that the constant as given is the most accurate 
value for IEEE-754 floats.

Tim Peters has answered that: https://stackoverflow.com/a/48653387

"Either way, the code ensures the best 53-bit approximation to log(2) will be 
used."

so there is no other value that ln2 can be given that is more accurate given 
the limitation of 53-bits.

https://stackoverflow.com/a/48653387

The difference between the given value and the mathematically precise value is 
not a bug but intentional. I'm not closing this ticket as I think that this 
should be documented in the source, to prevent future confusion.

--
nosy: +steven.daprano, tim.peters
stage:  -> needs patch

___
Python tracker 

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



[issue6135] subprocess seems to use local encoding and give no choice

2018-02-06 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5391

___
Python tracker 

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



[issue6135] subprocess seems to use local encoding and give no choice

2018-02-06 Thread aicirbs

Change by aicirbs :


--
pull_requests: +5389

___
Python tracker 

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



[issue32783] ln(2) isn't accurate in _math.c in cpython

2018-02-06 Thread Matanya Stroh

New submission from Matanya Stroh :

In cpython/Modules/_math.c there is definition of as const ln2
the value that in that const isn't correct (at least not accurate)

This is value that in the file:

ln2 = 0.693147180559945286227 (cpython)

but when calculating the value in wolframalpha, this is the value we get.
ln2 = 0.6931471805599453094172321214581 (wolframalpha)

and this is the value from Wikipedia
ln2 = 0.693147180559945309417232121458 (wikipedia)

also this is the thread in stackoverflow regarding this issue
https://stackoverflow.com/questions/48644767/ln2-const-value-in-math-c-in-cpython

--
components: Library (Lib)
messages: 311749
nosy: matanya.stroh
priority: normal
severity: normal
status: open
title: ln(2) isn't accurate in _math.c in cpython
type: behavior
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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-06 Thread Ned Deily

Ned Deily  added the comment:

Quick test: there doesn't seem to be a similar regression when building 3.6 
with the current clang provided by Xcode 9.2, just with 2.7.  And both 2.7 and 
3.6 configure HAVE_COMPUTED_GOTOS on.  Benjamin?

(FWIW, the 2.7.x binaries provided by the python.org installers do not suffer 
from this performance regression as they are not built with clang.)

--
components:  -macOS
nosy: +benjamin.peterson

___
Python tracker 

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



[issue32773] distutils should NOT preserve timestamps

2018-02-06 Thread Jeroen Demeyer

Jeroen Demeyer  added the comment:

I am genuinely curious to hear a good reason why timestamps should be preserved 
by distutils. I cannot really imagine what could possibly break. As I said, 
this is the standard for many non-Python projects and it seems to work just 
fine.

I can see one potential backwards-compatibility issue for projects abusing 
distutils to do things unrelated to installing Python packages. So I understand 
that you don't want to change the default in the copy_file() function, but only 
in the methods calling that function.

--

___
Python tracker 

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



[issue32783] ln(2) isn't accurate in _math.c in cpython

2018-02-06 Thread R. David Murray

Change by R. David Murray :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue32783] ln(2) isn't accurate in _math.c in cpython

2018-02-06 Thread Christian Heimes

Christian Heimes  added the comment:

Welcome to the astounding world of IEEE 754 floating point operations. Python's 
float type is based on C's 64bit double precision float. The value in _math.c 
is as precise as a double is able to contain:

>>> 0.6931471805599453094172321214581 == 0.693147180559945286227
True
>>> 0.6931471805599453094172321214581
0.6931471805599453
>>> 0.693147180559945286227
0.6931471805599453

Strictly speaking any of the numbers in your initial message are wrong. It's 
not possible to express ln2 is a number of finite length. The approximations 
are usually good enough, though.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue5594] IDLE: execute stored startup code on each Shell start.

2018-02-06 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
pull_requests:  -5367

___
Python tracker 

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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-06 Thread Zhiming Wang

Zhiming Wang  added the comment:

Turns out python 2.7.10 doesn't suffer from the performance issue even when 
compiled with stock clang 4.x, and upon further investigation, I tracked down 
the commit that introduced the regression:

commit 2c992a0788536087bfd78da8f2c62b30a461d7e2
Author: Benjamin Peterson 
Date:   Thu May 28 12:45:31 2015 -0500

backport computed gotos (#4753)

So Naoki was right that computed gotos is (solely) to blame here.

--

___
Python tracker 

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



[issue32773] distutils should NOT preserve timestamps

2018-02-06 Thread R. David Murray

R. David Murray  added the comment:

We have a strong backward compatibility policy, especially for distutils, so 
even though you can't imagine a use case I think we should keep the default the 
same.

You could try lobbying the folks at pypa and see if they disagree with me, 
since the opinion of the python core devs there would overrule me :)  Or 
perhaps one or more of the other nosy people here will chime in.

--
type:  -> enhancement
versions:  -Python 2.7, Python 3.4, Python 3.5, 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



[issue32773] distutils should NOT preserve timestamps

2018-02-06 Thread Jay Yin

Jay Yin  added the comment:

That's why I said to have the default be the old setting, so that any previous 
setups wouldn't need to changes (aka backward compat.) the option would give 
people the "option" to choose.

--

___
Python tracker 

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



[issue32773] distutils should NOT preserve timestamps

2018-02-06 Thread Jay Yin

Jay Yin  added the comment:

I can tackle this if it's alright?

--

___
Python tracker 

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



[issue32773] distutils should NOT preserve timestamps

2018-02-06 Thread Jeroen Demeyer

Jeroen Demeyer  added the comment:

> if so wouldn't that still require an internal option?

No, you just need to change the calls to the copy_file() function to add the 
keyword argument preserve_times=False

If you agree, then I could easily provide a patch.

--

___
Python tracker 

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



[issue32521] NIS module fails to build due to the removal of interfaces related to Sun RPC from glibc.

2018-02-06 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

Reopenning the issue.

python2 is still failing with the fix applied:

gcc -pthread -fPIC -fno-strict-aliasing -O2 -g -pipe -Wall 
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS 
-fexceptions -fstack-protector-strong -grecord-gcc-switches 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection 
-D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security 
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions 
-fstack-protector-strong -grecord-gcc-switches 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection 
-D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security 
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions 
-fstack-protector-strong -grecord-gcc-switches 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/r
 pm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables 
-fstack-clash-protection -mcet -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -I. 
-IInclude -I/builddir/build/BUILD/Python-2.7.14/Include   -c 
/builddir/build/BUILD/Python-2.7.14/Modules/nismodule.c -o Modules/nismodule.o
/builddir/build/BUILD/Python-2.7.14/Modules/nismodule.c:17:10: fatal error: 
rpc/rpc.h: No such file or directory
 #include 
  ^~~
compilation terminated.
{standard input}: Assembler messages:
{standard input}: Error: .size expression for nismodule.c does not evaluate to 
a constant
make: *** [Makefile:1568: Modules/nismodule.o] Error 1
make: *** Waiting for unfinished jobs

--
status: closed -> open

___
Python tracker 

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



[issue32764] Popen doesn't work on Windows when args is a list

2018-02-06 Thread Gregory P. Smith

Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith

___
Python tracker 

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



[issue32622] Implement loop.sendfile

2018-02-06 Thread Andrew Svetlov

Change by Andrew Svetlov :


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



[issue32647] Undefined references when compiling ctypes on binutils 2.29.1 with gcc -Wl, -z, undefs (Fedora 28)

2018-02-06 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

Just tested it for python3 on a rawhide system with the flag enabled and it 
works, ctypes is compiled successfully.

python2 is not affected the same way though, various modules fail there with 
different undefined references issues when setting the flag.

--

___
Python tracker 

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



[issue32768] object.__new__ does not accept arguments if __bases__ is changed

2018-02-06 Thread Guido van Rossum

Guido van Rossum  added the comment:

I fear that this is one of those cases that will longer in the tracker
forever. We probably shouldn't have allowed assignment to __bases__, and
the behavior is slightly surprising, but fixing it would be too complicated
and there's not enough interest in getting it fixed.

On Feb 6, 2018 12:13 AM, "VA"  wrote:

>
> VA  added the comment:
>
> The use case is a little more complex.
>
> I have a plugin system, with abstract interfaces. Plugins can't import
> each other, but plugins should be able to allowed to depend on another
> plugin (using string codes, still no direct imports), and even subclass
> another plugin's classes (and override some of their methods).
>
> In the sample code, A and C would be 2 plugins, and B would be a helper
> class (with string code parameters) whose purpose is to make a temporary
> bridge between A and C.
> A should work standalone. C would use A's code but could reimplement some
> of A's methods. B is a internal class that has A and C at hand, and changes
> C's __bases__ to point to A.
>
> I have been suggested other solutions, like using composition (a C
> instance would have an "a" field pointing to an A instance) to avoid
> inheritance altogether, or using the "type()" function in B.__new__ to
> create a custom class inheriting A.
> None of these solutions are really satisfying because they prevent C from
> using "super(...)" to refer to A methods.
> Rebinding __class__ simply does not allow to override methods at all.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue32647] Undefined references when compiling ctypes on binutils 2.29.1 with gcc -Wl, -z, undefs (Fedora 28)

2018-02-06 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

Attaching the build log from python2. Near the end you can see the undefined 
references errors.

--
Added file: https://bugs.python.org/file47426/py2buildlog

___
Python tracker 

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



[issue32784] Wrong argument name for csv.DictReader in documentation

2018-02-06 Thread Josh Rosenberg

Josh Rosenberg  added the comment:

Side-note: You say "how could i have known it was named 'f'?"

>>> help(csv.DictReader)
class DictReader
 |  Methods defined here:
 |
 |  __init__(self, f, fieldnames=None, restkey=None, restval=None, 
dialect='excel', *args, **kwds)
... rest of class help ...

Not saying the docs shouldn't be fixed, but the name is correctly given in the 
__init__ prototype (being implemented in Python, the names are always available 
to help() introspection, barring really specific cases of manual parsing of 
**kwargs). Just a general tip for the future.

--
nosy: +josh.r

___
Python tracker 

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



[issue32720] Format mini-language integer definition is incorrect

2018-02-06 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset a747cf6d9b87ea8c7ce3a42d09e5b966c8e83fa0 by Mariatta (Miss 
Islington (bot)) in branch '3.7':
bpo-32720: Fixed the replacement field grammar documentation. (GH-5544) 
(GH-5546)
https://github.com/python/cpython/commit/a747cf6d9b87ea8c7ce3a42d09e5b966c8e83fa0


--

___
Python tracker 

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



[issue32783] ln(2) isn't accurate in _math.c in cpython

2018-02-06 Thread Tim Peters

Tim Peters  added the comment:

As I mentioned on StackOverflow, the literal in question appears to have been 
crafted to convert to the best possible 53-bit binary approximation to log(2) 
regardless of whether a compiler converts it to double precision (53 bits of 
precision) or to "double extended" (64 bits of precision).  In the latter case, 
the literal is such that the "extra" trailing 11 bits are all zeroes.

Since I doubt that's a potential issue anymore, even trying to document it 
would be confusing too ;-)

So while I'll defer to Mark, I'm inclined to just close this as "not a bug".  
Math libraries typically bristle with code that's baffling to the uninitiated, 
and comments about things that don't matter can get in the way.  The only thing 
a libm developer cares about here is whether or not the literal converts to the 
best double approximation to log(2) - and it does.

--

___
Python tracker 

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



[issue32784] Wrong argument name for csv.DictReader in documentation

2018-02-06 Thread cowlinator

New submission from cowlinator :

The documentation for the csv.DictReader constructor (and presumably 
csv.DictWriter also) has the wrong name written for the first argument.  This 
prevents the argument from being called by name.

>>> file = open("file.txt", 'a')
>>> csv.DictReader(csvfile=file)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __init__() takes at least 2 arguments (1 given)
>>> csv.DictReader(f=file)

>>> # how could i have known it was named 'f'?

Please change the documentation.

--
messages: 311759
nosy: cowlinator
priority: normal
severity: normal
status: open
title: Wrong argument name for csv.DictReader in documentation
versions: Python 2.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



[issue32784] Wrong argument name for csv.DictReader in documentation

2018-02-06 Thread R. David Murray

R. David Murray  added the comment:

In the python3 docs it is given as 'f'.  In the python2 docs, it is not.  I 
suppose a doc backport was missed.

--
nosy: +r.david.murray
versions:  -Python 3.5

___
Python tracker 

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



[issue6135] subprocess seems to use local encoding and give no choice

2018-02-06 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset 4e7a964aaf4374fa2f6b45cf5161fa6cd53aec19 by Gregory P. Smith 
(Miss Islington (bot)) in branch '3.7':
bpo-6135: Fix subprocess.check_output doc to mention changes in 3.6 (GH-5564) 
(GH-5572)
https://github.com/python/cpython/commit/4e7a964aaf4374fa2f6b45cf5161fa6cd53aec19


--

___
Python tracker 

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



[issue6135] subprocess seems to use local encoding and give no choice

2018-02-06 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset 7f95c8c319c1ee593b130d0eb1d4947d9d7e008a by Gregory P. Smith 
(Miss Islington (bot)) in branch '3.6':
bpo-6135: Fix subprocess.check_output doc to mention changes in 3.6 (GH-5564) 
(GH-5573)
https://github.com/python/cpython/commit/7f95c8c319c1ee593b130d0eb1d4947d9d7e008a


--

___
Python tracker 

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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-06 Thread INADA Naoki

Change by INADA Naoki :


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

___
Python tracker 

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



[issue32786] Didnot work strftime() when hangeul in format sting

2018-02-06 Thread Myungseo Kang

New submission from Myungseo Kang :

Good morning.
I have a question while writing Python code in Django.

I got empty string when I ran code in a screenshot.
But it works in python interprerter(python manage.py shell).
I don't know why it works or didn't work.
I think maybe hangeul is related.
Please confirm this issue.

I used Django 1.11, Python 3.4.4 version.

--
components: Argument Clinic
files: 스크린샷 2018-02-07 오후 3.24.05.png
messages: 311771
nosy: larry, leop0ld
priority: normal
severity: normal
status: open
title: Didnot work strftime() when hangeul in format sting
type: behavior
versions: Python 3.4
Added file: https://bugs.python.org/file47427/스크린샷 2018-02-07 오후 
3.24.05.png

___
Python tracker 

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



[issue32784] Wrong argument name for csv.DictReader in documentation

2018-02-06 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi @Serhiy

I try to use the cherry-picking method for the patch from 3.6 but without 
success, I preferred to reuse my initial commit and remove the News.d entry.

--

___
Python tracker 

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



[issue32785] Change the name of the 'f' argument of csv.DictReader and csv.DictWriter

2018-02-06 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

thanks

--

___
Python tracker 

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



[issue32784] Wrong argument name for csv.DictReader in documentation

2018-02-06 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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

___
Python tracker 

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



[issue32784] Wrong argument name for csv.DictReader in documentation

2018-02-06 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

I just fixed the documentation, but I think we should change the name of the 
first parameter in master for 3.8. Maybe for 3.7, because we have to fix the 
docs. 

@david, what is your opinion?

I am going to propose a PR for the naming of the first argument

--
keywords: +needs review -patch
nosy: +matrixise

___
Python tracker 

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



[issue32785] Change the name of the 'f' argument of csv.DictReader and csv.DictWriter

2018-02-06 Thread Stéphane Wirtel

New submission from Stéphane Wirtel :

The name of the first argument of csv.DictReader and csv.DictWriter is 'f', I 
propose to rename it to 'csvfile' to be more consistent. 
It's just a small refactoring based on the issue #32784

--
messages: 311766
nosy: matrixise
priority: normal
severity: normal
status: open
title: Change the name of the 'f' argument of csv.DictReader and csv.DictWriter
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



[issue32784] Wrong argument name for csv.DictReader in documentation

2018-02-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

See issue16026 for the fix in 3.x.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32768] object.__new__ does not accept arguments if __bases__ is changed

2018-02-06 Thread Nick Coghlan

Nick Coghlan  added the comment:

>From VA's description of the intended use case, this actually sounds a bit 
>like a variant of https://bugs.python.org/issue29944: one reason that 
>replacing C with a new dynamically constructed type won't work reliably is 
>because some of the methods might have captured references to the original 
>type via closure cells, so zero-arg super() will still fail, even if you 
>rebind the name at the module level.

Even __set_name__ can't reliably help with that, since it would rely on every 
descriptor passing on the __set_name__ call to wrapped objects.

While the problem likely isn't fixable for the class-cloning case, we may be 
able to do something about the class-replacement case by exposing the zero-arg 
super() class cell as an attribute on the class object.

If we did that, then methods on the original class could be pointed at the new 
class by doing "original_class.__classcell__.cell_contents = new_class".

--

___
Python tracker 

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



[issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs)

2018-02-06 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

If a task refuses to be cancelled, then is waiting for it forever actually 
wrong? That's the same thing as happens if I do 'task.cancel(); await task', 
right? Currently wait_for will abandon such a task, but then it's still left 
running in the background indefinitely (creating a memory leak or worse).

--

___
Python tracker 

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



[issue32785] Change the name of the 'f' argument of csv.DictReader and csv.DictWriter

2018-02-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Duplicate of issue16026.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> csv.DictReader argument names documented incorrectly

___
Python tracker 

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



[issue32782] ctypes: memoryview gives incorrect PEP3118 itemsize for array of length zero

2018-02-06 Thread Eric Wieser

Change by Eric Wieser :


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

___
Python tracker 

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



[issue32781] lzh_tw is missing in locale.py

2018-02-06 Thread Po-Hsu Lin

New submission from Po-Hsu Lin :

The lzh_tw locale (Literary Chinese) is not available in Lib/locale.py

This issue will cause error like:

Traceback (most recent call last):
  File "/usr/share/apport/apport-gtk", line 598, in 
app.run_argv()
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 694, in run_argv
return self.run_crashes()
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 245, in run_crashes
logind_session[1] > self.report.get_timestamp():
  File "/usr/lib/python3/dist-packages/apport/report.py", line 1684, in 
get_timestamp
orig_ctime = locale.getlocale(locale.LC_TIME)
  File "/usr/lib/python3.6/locale.py", line 581, in getlocale
return _parse_localename(localename)
  File "/usr/lib/python3.6/locale.py", line 490, in _parse_localename
raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: lzh_TW

This can be easily reproduced in Ubuntu 17.10, with English selected as the 
default language, but Timezone set to Taipei. This will set the locale to:

$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=lzh_TW
LC_TIME=lzh_TW
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=lzh_TW
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=lzh_TW
LC_NAME=lzh_TW
LC_ADDRESS=lzh_TW
LC_TELEPHONE=lzh_TW
LC_MEASUREMENT=lzh_TW
LC_IDENTIFICATION=lzh_TW
LC_ALL=

And when running some python script to call locale.py, you will see the error 
message above.

--
components: Library (Lib)
messages: 311717
nosy: cypressyew
priority: normal
severity: normal
status: open
title: lzh_tw is missing in locale.py
versions: Python 3.6

___
Python tracker 

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



[issue32781] lzh_tw is missing in locale.py

2018-02-06 Thread INADA Naoki

INADA Naoki  added the comment:

Maybe, relating to 
https://bugs.launchpad.net/ubuntu/+source/language-pack-zh-hant/+bug/1699540

--
nosy: +inada.naoki

___
Python tracker 

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



[issue32768] object.__new__ does not accept arguments if __bases__ is changed

2018-02-06 Thread VA

VA  added the comment:

The use case is a little more complex.

I have a plugin system, with abstract interfaces. Plugins can't import each 
other, but plugins should be able to allowed to depend on another plugin (using 
string codes, still no direct imports), and even subclass another plugin's 
classes (and override some of their methods).

In the sample code, A and C would be 2 plugins, and B would be a helper class 
(with string code parameters) whose purpose is to make a temporary bridge 
between A and C.
A should work standalone. C would use A's code but could reimplement some of 
A's methods. B is a internal class that has A and C at hand, and changes C's 
__bases__ to point to A.

I have been suggested other solutions, like using composition (a C instance 
would have an "a" field pointing to an A instance) to avoid inheritance 
altogether, or using the "type()" function in B.__new__ to create a custom 
class inheriting A.
None of these solutions are really satisfying because they prevent C from using 
"super(...)" to refer to A methods.
Rebinding __class__ simply does not allow to override methods at all.

--

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-06 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

If the fix will land into 3.6 bugfix release only -- I can live with it, while 
the overall looks tricky.

Ned Deily, what do you think about?

--

___
Python tracker 

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