[issue25155] Windows: datetime.datetime.now() raises an OverflowError for date after year 2038

2018-06-26 Thread Petter S


Petter S  added the comment:

I also compiled Python myself on WSL.

The bug seemed to appear after computer had been running for a while. Before 
that, the interpreters were working normally. And after rebooting the problem 
disappeared.

--

___
Python tracker 

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



[issue24567] random.choice IndexError due to double-rounding

2018-06-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

[Tim]
> Mark, do you believe that 32-bit Linux uses a different libm?

I don't know. But I'd expect to see accuracy losses as a result of forcing 
53-bit precision, and I wouldn't be totally surprised to see other more 
catastrophic failure modes (infinite iterations, for example). But I don't have 
any concrete information on the subject.

There's this from (an unofficial mirror of) the glibc x86 sources: 
https://github.com/bminor/glibc/blob/43b1048ab9418e902aac8c834a7a9a88c501620a/sysdeps/x86/fpu_control.h#L69

> #define _FPU_EXTENDED 0x300   /* libm requires double extended precision.  */

But it's not clear to me whether that comment is intended to be a statement of 
fact, or indeed whether it's still true or just an ancient comment that should 
have been culled long ago.

Like I said, I just don't know, but I'd be worried about the law of unintended 
consequences.

Of course, with my Enthought hat on, I don't care, because we stopped worrying 
about 32-bit Linux long ago... :-)

--

___
Python tracker 

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



[issue33965] [Windows WSL] Fatal Python error: _Py_InitializeMainInterpreter: can't initialize time, after year 2038

2018-06-26 Thread STINNER Victor


New submission from STINNER Victor :

Petter S commented the closed bpo-25155, so I open a new issue. Copy of 
messages starting at https://bugs.python.org/issue25155#msg320431:

msg320431 - (view)  Author: Petter S (Petter S) *   Date: 2018-06-25 17:52

I get this error when starting the interpreter in Windows subsystem for Linux 
(WSL). 

I am using Python 2.7.15rc1

$ python --version
Python 2.7.15rc1
$ python
Fatal Python error: _Py_InitializeMainInterpreter: can't initialize time

  OverflowError: timestamp too 
large to convert to C _PyTime_t 



   Current 
thread 0x7fe547231080 (most recent call first): 

  Aborted (core dumped)

msg320432 - (view)  Author: Petter S (Petter S) *   Date: 2018-06-25 17:55

For Python 3:

$ python3 --version
Python 3.7.0b3
$ python3
Fatal Python error: _Py_InitializeMainInterpreter: can't initialize time
OverflowError: timestamp too large to convert to C _PyTime_t

Current thread 0x7f0232c21080 (most recent call first):
Aborted (core dumped)

msg320441 - (view)  Author: STINNER Victor (vstinner) * (Python committer)  
Date: 2018-06-25 21:06

> I get this error when starting the interpreter in Windows subsystem for Linux 
> (WSL).

This bug is currently closed, please open a new bug.

About your issue. I'm not sure if Windows subsystem for Linux is officially 
supported. How did you install Python 2.7 and 3.7? Are you testing 32-bit or 
64-bit Python? (Again, please answer in your new issue.)

msg320447 - (view)  Author: STINNER Victor (vstinner) * (Python committer)  
Date: 2018-06-25 22:05

I tried 64-bit builds of Python 2.7 and 3.7rc1 (binaries from python.org) on 
Windows 10 on year 2045: start with no error, time.time() and 
datetime.datetime.now() don't fail.

I tried Python 2.7.12 and 3.5.2 on Ubuntu 16.04 in WSL on my Windows 10: same, 
start with no error, time.time() and datetime.datetime.now() don't fail. It's 
64-bit Ubuntu with 64-bit binaries for Python 2 and Python 3 (check 
sys.maxsize).

I even compiled Python 2.7.15 and 3.7rc1 on Ubuntu 16.04 in WSL on my Windows 
10: same again, start with no error, time.time() and datetime.datetime.now() 
don't fail. Python 2 and 3 have been compiled in 64-bit mode, since it's a 
64-bit Ubuntu.

Everything is fine. I failed to reproduce your bug.

msg320473 - (view)  Author: Petter S (Petter S) *   Date: 2018-06-26 07:26

I also compiled Python myself on WSL.

The bug seemed to appear after computer had been running for a while. Before 
that, the interpreters were working normally. And after rebooting the problem 
disappeared.

--
components: Interpreter Core, Windows
messages: 320475
nosy: paul.moore, steve.dower, tim.golden, vstinner, zach.ware
priority: normal
severity: normal
status: open
title: [Windows WSL] Fatal Python error: _Py_InitializeMainInterpreter: can't 
initialize time, after year 2038
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



[issue25155] Windows: datetime.datetime.now() raises an OverflowError for date after year 2038

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

I created bpo-33965: [Windows WSL] Fatal Python error: 
_Py_InitializeMainInterpreter: can't initialize time, after year 2038.

--

___
Python tracker 

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



[issue33965] [Windows WSL] Fatal Python error: _Py_InitializeMainInterpreter: can't initialize time, after year 2038

2018-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +Petter S

___
Python tracker 

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



[issue33965] [Windows WSL] Fatal Python error: _Py_InitializeMainInterpreter: can't initialize time, after year 2038

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

Petter S:

* What is your Windows version?
* Which operating system are you running on WSL? Name and version?
* In WSL: can you copy/paste the output of "uname -a"? What is your compiler 
version? Are you compiling in 32-bit or 64-bit mode?


Maybe the exception came from:

static int
pymonotonic(_PyTime_t *tp, _Py_clock_info_t *info, int raise)
{
#if defined(MS_WINDOWS)
...
if (_PyTime_check_mul_overflow(t, MS_TO_NS)) {
if (raise) {
_PyTime_overflow();
return -1;
}
/* Hello, time traveler! */
Py_UNREACHABLE();
}
...
}

--

___
Python tracker 

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



[issue33930] Segfault with deep recursion into object().__dir__

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

C traceback in gdb:

Program received signal SIGSEGV, Segmentation fault.
0x004812a8 in meth_dealloc (
m=)
at Objects/methodobject.c:86
86  {
(gdb) where
#0  0x004812a8 in meth_dealloc (
m=)
at Objects/methodobject.c:86
#1  0x00488d9f in _Py_Dealloc (
op=) at Objects/object.c:1931
#2  0x004813c4 in meth_dealloc (m=0x7fffe3973580)
at Objects/methodobject.c:91
#3  0x00488d9f in _Py_Dealloc (
op=) at Objects/object.c:1931
#4  0x004813c4 in meth_dealloc (m=0x7fffe39735f8)
at Objects/methodobject.c:91
#5  0x00488d9f in _Py_Dealloc (
op=) at Objects/object.c:1931
#6  0x004813c4 in meth_dealloc (m=0x7fffe3973670)
at Objects/methodobject.c:91
#7  0x00488d9f in _Py_Dealloc (
op=) at Objects/object.c:1931
#8  0x004813c4 in meth_dealloc (m=0x7fffe39736e8)
at Objects/methodobject.c:91
(...)

--

___
Python tracker 

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



[issue24567] random.choice IndexError due to double-rounding

2018-06-26 Thread Mark Dickinson

Mark Dickinson  added the comment:

Some relevant notes from Vincent Lefèvre here: 
http://www.vinc17.net/research/extended.en.html

--

___
Python tracker 

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



[issue33958] Unused variable in pure embedding example

2018-06-26 Thread Philip Kendall


Philip Kendall  added the comment:

Thanks thatiparthy :-)

--
title: Unused variable in pur embedding example -> Unused variable in pure 
embedding example

___
Python tracker 

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



[issue33957] use standard term than generic wording

2018-06-26 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue33957] use standard term than generic wording

2018-06-26 Thread INADA Naoki


Change by INADA Naoki :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue33957] use standard term than generic wording

2018-06-26 Thread miss-islington


miss-islington  added the comment:


New changeset 829b7669f070a6228bba5c7a10a05b12891a95fd by Miss Islington (bot) 
in branch '3.7':
bpo-33957: Doc: Use better wording (GH-7912)
https://github.com/python/cpython/commit/829b7669f070a6228bba5c7a10a05b12891a95fd


--
nosy: +miss-islington

___
Python tracker 

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



[issue21914] Create unit tests for Turtle guionly

2018-06-26 Thread RAJALAKSHMI V


RAJALAKSHMI V  added the comment:

Hey, I am a new contributor here. Could I take this issue up?

--
nosy: +RAJALAKSHMI V

___
Python tracker 

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



[issue33671] Efficient zero-copy for shutil.copy* functions (Linux, OSX and Win)

2018-06-26 Thread desbma


Change by desbma :


--
nosy:  -desbma

___
Python tracker 

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



[issue33966] test_multiprocessing_spawn.WithProcessesTestPool.test_traceback() leaks 4 handles on Windows

2018-06-26 Thread STINNER Victor


New submission from STINNER Victor :

Using my PR 7827, the following command shows a leak of 4 Windows handles per 
run:

python -m test -R 3:3 test_multiprocessing_spawn -v -m 
test.test_multiprocessing_spawn.WithProcessesTestPool.test_traceback

See also bpo-33929: test_multiprocessing_spawn: 
WithProcessesTestProcess.test_many_processes() leaks 5 handles on Windows.

--
components: Library (Lib), Windows
messages: 320484
nosy: davin, paul.moore, pitrou, steve.dower, tim.golden, vstinner, zach.ware
priority: normal
severity: normal
status: open
title: test_multiprocessing_spawn.WithProcessesTestPool.test_traceback() leaks 
4 handles on Windows
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



[issue33967] functools.singledispatch: Misleading exception when calling without arguments

2018-06-26 Thread Walter Dörwald

New submission from Walter Dörwald :

When I call a function decorated with functools.singledispatch without an 
argument, I get the following:

$ python
Python 3.6.5 (default, Jun 17 2018, 12:13:06)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import functools
>>> @functools.singledispatch
... def f(x):
... pass
...
>>> f()
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/functools.py",
 line 803, in wrapper
return dispatch(args[0].__class__)(*args, **kw)
IndexError: tuple index out of range

I would have expected a TypeError along the lines of

TypeError: f() missing 1 required positional argument: 'x'

--
components: Library (Lib)
messages: 320485
nosy: doerwalter
priority: normal
severity: normal
status: open
title: functools.singledispatch: Misleading exception when calling without 
arguments
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



[issue33968] os.makedirs and empty string

2018-06-26 Thread Carl Andersson


New submission from Carl Andersson :

os.makedirs does not handle the empty string the same way as the os.path.XX 
functions does. This is (to me) unexpected behaviour, since calls like 
`os.makedirs(os.path.dirname(filename), exist_ok=True)` raises an exception if 
`filename` does not contain any directories.
Also, it raises an `FileNotFoundError` regardless of the `exist_ok` flag. I 
would expect `os.makedirs('')` to fail with `FileExistsError` and 
`os.makedirs('', exist_ok=True)` to not do anything.

--
components: Library (Lib)
messages: 320486
nosy: CarlAndersson
priority: normal
severity: normal
status: open
title: os.makedirs and empty string
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



[issue33969] "copytree" refuses to copy to a mount point

2018-06-26 Thread James Stevens


New submission from James Stevens :

Even if the mount-point directory is empty, "copytree" refuses to copy to a it 
becuase it will not perform a copy if the destination directory already exists 
- although it will accept any of the parents of destination existing, or not. 
Therefore, "copytree" is unable to copy to the top directory of (say) a USB 
Stick.

This also means "copytree" can't be used to merge the contents of two source 
directories into a single destination. etc,etc

This one flaw means that the use scenarios for "copytree" are actually 
extremely limited when compared to (say) "cp" - but running 
"subprocess.call(["cp","-a",...])" as commonly recommended on StackOverflow is 
not an ideal solution for lots of reasons.

--
components: Distutils
messages: 320487
nosy: dstufft, eric.araujo, james_r_c_stevens
priority: normal
severity: normal
status: open
title: "copytree" refuses to copy to a mount point
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



[issue33970] bugs.python.org silently refuses registrations

2018-06-26 Thread James Stevens


New submission from James Stevens :

bugs.python.org silently refuses registration if the user's "homepage" does not 
match some undisclosed URL validation test.

The fact of the validation failure of the "homepage" is not disclosed at any 
time, including both the initial registration and at activation time.

This appears to have been a "known" issue for at least a year, but is still not 
fixed.

http://psf.upfronthosting.co.za/roundup/meta/issue591

--
assignee: docs@python
components: Documentation
messages: 320488
nosy: docs@python, james_r_c_stevens
priority: normal
severity: normal
status: open
title: bugs.python.org silently refuses registrations
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



[issue33970] bugs.python.org silently refuses registrations

2018-06-26 Thread Mariatta Wijaya


Mariatta Wijaya  added the comment:

Thanks for the report.
As you have found out, the issue tracker for the bug tracker itself is not here.

It seems to be a problem in upstream roundup.

If you can help with fixing this issue, please see the discussion in 
http://psf.upfronthosting.co.za/roundup/meta/issue591
as well as http://issues.roundup-tracker.org/issue2550920

You can also read https://wiki.python.org/moin/TrackerDevelopment about 
development of the bug tracker itself.

--
assignee: docs@python -> 
components:  -Documentation
nosy: +Mariatta
resolution:  -> third party
stage:  -> resolved
status: open -> closed
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



[issue33971] os.mknod is subject to "umask"

2018-06-26 Thread James Stevens


New submission from James Stevens :

As per the underlying "libc" call, the node created with "mknod" is subjected 
to the user's current umask setting.

This is not made clear in the Python documentation, but the "libc" 
documentation makes this clear (see attached).

--
assignee: docs@python
components: Documentation
files: Selection_2018-06-26_003.png
messages: 320490
nosy: docs@python, james_r_c_stevens
priority: normal
severity: normal
status: open
title: os.mknod is subject to "umask"
versions: Python 3.6
Added file: https://bugs.python.org/file47653/Selection_2018-06-26_003.png

___
Python tracker 

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



[issue33965] [Windows WSL] Fatal Python error: _Py_InitializeMainInterpreter: can't initialize time, after year 2038

2018-06-26 Thread Steve Dower


Steve Dower  added the comment:

Also please include your sys.version. It is possible to launch Windows 
applications from WSL, which means we need to know if you ran the Linux version 
or the Windows version (though it sounds like it was a Linux version which 
means MS_WINDOWS is not defined).

--

___
Python tracker 

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



[issue33873] False positives when running leak tests with -R 1:1

2018-06-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 58ed7307ea0b5c5aa052291ebc3030f314f938d8 by Pablo Galindo in 
branch 'master':
bpo-33873: Fix bug in `runtest.py` and add checks for invalid `-R` parameters 
(GH-7735)
https://github.com/python/cpython/commit/58ed7307ea0b5c5aa052291ebc3030f314f938d8


--

___
Python tracker 

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



[issue33968] os.makedirs and empty string

2018-06-26 Thread Emily Morehouse

Emily Morehouse  added the comment:

This is an interesting behavior to note. I think the current behavior makes the 
most sense, as it corresponds to the OS-level errors that you get from running 
the same operations.

Interestingly, at least on Unix-based file systems, we get different error 
messages but the same behavior when using "" vs "." as our target:

[linux]$ mkdir ""
mkdir: cannot create directory ‘’: No such file or directory
[linux]$ mkdir .
mkdir: cannot create directory ‘.’: File exists

[mac]$ mkdir ""
mkdir: .: No such file or directory
[mac]$ mkdir .
mkdir: .: File exists

Both os.mkdir and os.makedirs follow (only os.mkdir is included as the 
traceback is cleaner, but they raise the same errors):
>>> os.mkdir("")
Traceback (most recent call last):
  File "", line 1, in 
FileNotFoundError: [Errno 2] No such file or directory: ''
>>> os.mkdir(".")
Traceback (most recent call last):
  File "", line 1, in 
FileExistsError: [Errno 17] File exists: '.'


Since on an OS level the only time "File exists" is returned is when using "." 
and not "", os.makedirs with exists_ok=True also follows:

>>> os.makedirs("", exist_ok=True)
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/os.py",
 line 220, in makedirs
mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: ''
>>> os.makedirs(".", exist_ok=True)
>>>

Basically, the FileExistsError gets silenced, but FileNotFoundError is left 
alone. I can see how the differences are nuanced and not obvious though.


Unless you think there is a succinct and worthwhile way of adding this to the 
documentation, I think this issue can be closed.

--
nosy: +emilyemorehouse

___
Python tracker 

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



[issue33972] AttributeError in email.message.iter_attachments()

2018-06-26 Thread Sven Krohlas


New submission from Sven Krohlas :

Hello everyone,

Today I stumbled over unexpected behaviour when parsing emails with Python 3.5.

mail is of type: 


Traceback (most recent call last):
File "XXX", line YYY, in ZZZ
for attachment in mail.iter_attachments():
File "/usr/lib/python3.5/email/message.py", line 1025, in iter_attachments
parts = self.get_payload().copy()
AttributeError: 'str' object has no attribute 'copy'


/usr/lib/python3.5/email/message.py calls self.get_payload().copy() without 
distinguishing between different possible return types of get_payload().

get_payload() belongs to class MIMEPart(Message)

>From the (base) class Message:


"def get_payload(self, i=None, decode=False):
"""Return a reference to the payload.

The payload will either be a list object or a string."

So, it might return a string, which seems to be the case I'm hitting here.

The code in cpython trunk still looks identical apart from a few line offsets, 
so newer versions might be affected, too.

Am I doing something wrong or do we have a bug to squash here?

Thanks,
Sven

--
components: email
messages: 320494
nosy: barry, r.david.murray, skrohlas
priority: normal
severity: normal
status: open
title: AttributeError in email.message.iter_attachments()
type: crash
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



[issue33968] os.makedirs and empty string

2018-06-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Concur with Emily.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33466] Distutils does not support the compilation of Objective-C++ (“.mm”) files

2018-06-26 Thread Éric Araujo

Éric Araujo  added the comment:

In short:

- Approve the PR (the bots will remove label «core review needed» and add 
«waiting for merge»

- Do not add «backport» labels as this is a new feature

- Push the squash and merge button
  - edit the commit message first line to have GH-123 instead of #123
  - edit the pre-filled commit message body to something better

- Watch CI on the master branch then buildbots

--

___
Python tracker 

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



[issue33968] os.makedirs and empty string

2018-06-26 Thread Carl Andersson


Carl Andersson  added the comment:

I can see the point in keeping the behaviour close to the OS-level commands, 
but the discrepancy between os.mkdir (or os.makedirs) and os.path.dirname is 
not resolved.

I still think that
>>> os.makedirs(os.path.dirname(filename), exist_ok=True)
should be able to handle the case when "filename" does not contain any 
directories.
A possible workaround would be to use os.path.abspath somewhere in the mix.

In my humble opinion creating the directory structure required to write a file 
should not require this level of complexity, since it is such a common 
operation.

--
nosy:  -serhiy.storchaka

___
Python tracker 

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



[issue33968] os.makedirs and empty string

2018-06-26 Thread Emily Morehouse


Emily Morehouse  added the comment:

I'll defer to Serhiy's os.path expertise, but from what I know -- os.dirname is 
essentially a helper function for returning the first item of split. 

What I'm gathering is that you're looking for a more advanced way of parsing a 
file path -- say "nested/dir/sample.txt" -- to "nested/dir" while also handling 
parsing "" into ".". 

Not the prettiest, but you could wrap os.path.dirname in os.path.normpath:

>>> os.path.normpath(os.path.dirname("nested/dir/sample.txt"))
'nested/dir'
>>> os.path.normpath(os.path.dirname(""))
'.'

--

___
Python tracker 

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



[issue33962] IDLE: use ttk.spinbox

2018-06-26 Thread Mark Roseman


Mark Roseman  added the comment:

For now, using a (likely very minimal) subset of commands/options common to 
both classic and ttk spinbox versions in IDLE sounds good. 

I was originally thinking stick with "-textvariable" for setting (which works 
on both) but I like your idea of adding "set" to a tk.spinbox subclass.

--

___
Python tracker 

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



[issue17496] OS X test for Tk availability in runtktests.py doesn't work

2018-06-26 Thread Mark Roseman


Mark Roseman  added the comment:

Just to note, this remains a PITA. To run gui tests on macOS from a terminal 
window seems to require commenting out the SetFrontProcess() call. A better 
replacement is needed as noted in the previous discussion, as well this call 
was deprecated in OS X 10.9 (though has not yet been removed as of this 
writing).

In the interim, is there a precedent for adding another command line option to 
the 'test' module, e.g. '--forcemacgui' so that people who want to can run 
those tests from a clean checkout?

--
nosy: +markroseman
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



[issue33962] IDLE: use ttk.spinbox

2018-06-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

ttk.Spinbox inherits from ttk.Entry.  My option list left out the options for 
Entry, which is one of the ttk widget not in the doc.  The additional entry 
options include exportselection, justify, show, state, textvariable, and width.
https://www.tcl.tk/man/tcl8.6/TkCmd/ttk_spinbox.htm
explicitly says textvariable is supported.  This is important because 
configdialog uses tracers on Var to detect and record user changes.

--

___
Python tracker 

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



[issue24567] random.choice IndexError due to double-rounding

2018-06-26 Thread Tim Peters


Tim Peters  added the comment:

Mark, ya, I agree it's most prudent to let sleeping dogs lie.

In the one "real" complaint we got (issue 24546) the cause was never determined 
- but double rounding was ruled out in that specific case, and no _plausible_ 
cause was identified (short of transient HW error).

As the years go by, my interest in "doing something" about a bug nobody has 
apparently encountered in the wild, and remains theoretically possible on an 
ever-diminishing number of platforms ("32-bit Linux not using faster SSE 
arithmetic" seems to be the universe), has faded somewhat  ;-)

So I'd close as "won't fix".  If I had to do something, I'd add different 
implementations under an "if this box does double-rounding" import-time test so 
nobody else has to pay for it.

But I'm cool with whatever Raymond settles for.

--

___
Python tracker 

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



[issue33871] Possible integer overflow in iov_setup()

2018-06-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2018-06-26 Thread Bert JW Regeer


Bert JW Regeer  added the comment:

I'll take a look and see if I can get the other fixes from WebOb and add them 
to a patch, and create a follow-up PR.

If I can stop carrying a monkey patch for the standard library I am all for it!

Thanks for running with this!

--
nosy: +Bert JW Regeer

___
Python tracker 

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



[issue33930] Segfault with deep recursion into object().__dir__

2018-06-26 Thread Alistair Buxton


Alistair Buxton  added the comment:

I found this while chatting on IRC about the implementation details of objects 
- specifically, since objects have a dict of attributes, and dict subclasses 
object, it seems like every dict will have another dict inside it. (Eventually 
someone explained that base object() doesn't have any state at all, as a result 
dict doesn't have a dict of attributes, and there is no cycle.)

Anyway, as I was trying to explain my question to the other users, I had 
intended to post this snippet and ask "why doesn't this crash python?" 
Ironically it turned out that it does crash python.

--

___
Python tracker 

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



[issue21914] Create unit tests for Turtle guionly

2018-06-26 Thread Lita Cho


Lita Cho  added the comment:

Feel free.

On Tue, Jun 26, 2018, 3:21 AM RAJALAKSHMI V  wrote:

>
> RAJALAKSHMI V  added the comment:
>
> Hey, I am a new contributor here. Could I take this issue up?
>
> --
> nosy: +RAJALAKSHMI V
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue33974] _stringify handles quoted strings incorrectly

2018-06-26 Thread Gauchj


New submission from Gauchj :

_stringify escapes special characters so they can be processed by tcl/tk. To 
that end, two different escaping techniques are implemented: put a backslash in 
front of every special character or put the entire string in curly braces.

However, a string like the following one:

'"C:\\Windows\\System32\\notepad.exe" "afile.txt"'

will be incorrectly escaped to

'"C:WindowsSystem32notepad.exe"\\ "afile.txt"'

Tcl/TK will interpret this as a quoted string, but with a backslash after it 
(the one escaping the space between the quoted strings), throwing this 
exception:
TclError('list element in quotes followed by "\\" instead of space',)

The attached patch escapes this to

'{"C:WindowsSystem32notepad.exe" "afile.txt"}'

I am not 100% sure that this is correct since double backslashes seem to be 
displayed now.

--
components: Tkinter
files: 0001-improve-escaping-of-quoted-strings.patch
keywords: patch
messages: 320508
nosy: gauchj
priority: normal
severity: normal
status: open
title: _stringify handles quoted strings incorrectly
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8
Added file: 
https://bugs.python.org/file47654/0001-improve-escaping-of-quoted-strings.patch

___
Python tracker 

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



[issue33973] HTTP request-line parsing splits on Unicode whitespace

2018-06-26 Thread Tim Burke

New submission from Tim Burke :

This causes (admittedly, buggy) clients that would work with a Python 2 server 
to stop working when the server upgrades to Python 3. To demonstrate, run 
`python2.7 -m SimpleHTTPServer 8027` in one terminal and `curl -v 
http://127.0.0.1:8027/你好` in another -- curl reports

*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8027 (#0)
> GET /你好 HTTP/1.1
> Host: 127.0.0.1:8027
> User-Agent: curl/7.54.0
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 404 File not found
< Server: SimpleHTTP/0.6 Python/2.7.10
< Date: Tue, 26 Jun 2018 17:23:25 GMT
< Content-Type: text/html
< Connection: close
<

Error response


Error response
Error code 404.
Message: File not found.
Error code explanation: 404 = Nothing matches the given URI.

* Closing connection 0

...while repeating the experiment with `python3.6 -m http.server 8036` and 
`curl -v http://127.0.0.1:8036/你好` gives

*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8036 (#0)
> GET /你好 HTTP/1.1
> Host: 127.0.0.1:8036
> User-Agent: curl/7.54.0
> Accept: */*
>
http://www.w3.org/TR/html4/strict.dtd";>



Error response


Error response
Error code: 400
Message: Bad request syntax ('GET /ä½\xa0好 HTTP/1.1').
Error code explanation: HTTPStatus.BAD_REQUEST - Bad request 
syntax or unsupported method.


* Connection #0 to host 127.0.0.1 left intact

Granted, a well-behaved client would have quoted the UTF-8 '你好' as 
'%E4%BD%A0%E5%A5%BD' (in which case everything would have behaved as expected), 
but RFC 7230 is pretty clear that the request-line should be SP-delimited. 
While it notes that "recipients MAY instead parse on whitespace-delimited word 
boundaries and, aside from the CRLF terminator, treat any form of whitespace as 
the SP separator", it goes on to say that "such whitespace includes one or more 
of the following octets: SP, HTAB, VT (%x0B), FF (%x0C), or bare CR" with no 
mention of characters like the (ISO-8859-1 encoded) non-breaking space that 
caused the 400 response.

FWIW, there was a similar unicode-separators-are-not-the-right-separators bug 
in header parsing a while back: https://bugs.python.org/issue22233

--
components: Library (Lib), Unicode
messages: 320507
nosy: ezio.melotti, tburke, vstinner
priority: normal
severity: normal
status: open
title: HTTP request-line parsing splits on Unicode whitespace
type: behavior
versions: Python 3.4, Python 3.5, 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



[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2018-06-26 Thread Chris Eykamp


Chris Eykamp  added the comment:

I don't know if you've read the dialog on the PR (there was also some offline 
between Ned and myself), but the patch breaks a test when running under a fresh 
build of Python.  I can't reproduce it here without setting up a build system, 
which I haven't had time to do, and won't be able to do at leat through the end 
of next week.

If you can run the tests on a fresh build of Python, and confirm that they 
break, that would be helpful.

--

___
Python tracker 

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



[issue33973] HTTP request-line parsing splits on Unicode whitespace

2018-06-26 Thread Tim Burke


Change by Tim Burke :


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

___
Python tracker 

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



[issue33930] Segfault with deep recursion into object().__dir__

2018-06-26 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

@victor: thanks for confirming my analysis.  

The trashcan API does fix this issue, although I did have to change 
"_PyObject_GC_UNTRACK(m);" to "PyObject_GC_UnTrack(m);" as well. I haven't 
checked yet why that's necessary.

--

___
Python tracker 

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



[issue33873] False positives when running leak tests with -R 1:1

2018-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7540

___
Python tracker 

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



[issue33873] False positives when running leak tests with -R 1:1

2018-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7541

___
Python tracker 

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



[issue33873] False positives when running leak tests with -R 1:1

2018-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7542

___
Python tracker 

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



[issue33718] Enhance regrtest: meta-ticket for multiple changes

2018-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7543

___
Python tracker 

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



[issue33873] False positives when running leak tests with -R 1:1

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

Since I didn't backport yet the commit 4ffe9c2b251f6e027b26250b7a2618e78d4edd22 
(format duration) from master to other branches, I will backport the commit 
58ed7307ea0b5c5aa052291ebc3030f314f938d8 (-R fix) manually to other branches 
with other recent regrtest changes.

--

___
Python tracker 

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



[issue24567] random.choice IndexError due to double-rounding

2018-06-26 Thread Tim Peters


Tim Peters  added the comment:

[Mark]
> If we do this, can we also persuade Guido to Pronounce that
> Python implementations assume IEEE 754 format and semantics
> for floating-point?

On its own, I don't think a change to force 53-bit precision _on_ 754 boxes 
would justify that.  That's just changing oddball boxes that already implement 
754 to do so in the way most other 754 boxes currently do it (and in the way 
all future 754 platforms are expected to do it).

To go beyond that seems to require addressing bigger questions, like:

- _Are_ there currently, or expected to be, non-754 Python platforms?  There 
have been in the past.

- What does "754 semantics" actually mean?  For example, as these bug reports 
point out, 754 is silent about whether the possibility of double rounding - 
even in primitive atomic operations - is "a bug" or "a feature" :-(  Would we 
insist that Python may not work on platforms that flush denorms to 0?  Etc.

- What, concretely, would change in CPython if the Pronouncement were made?  As 
I recall, we inherit most fp behaviors from the platform C compiler and 
libraries.  That is, how would the Pronouncement benefit CPython?  For example, 
do we have significant blobs of code that are trying to cater to non-754 boxes?

Not that I'm asking for answers here.  If there's something to be pursued here, 
I'd suggest it's better as a topic in python-ideas or python-dev.

--

___
Python tracker 

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



[issue33466] Distutils does not support the compilation of Objective-C++ (“.mm”) files

2018-06-26 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Eric,

Thanks. 

See the pull request for why this might qualify for a back port: other parts of 
distutils recognise '.mm' as a valid extension, but '.mm' doesn't work yet 
because UnixCCompiler doesn't support this yet. 

On the other hand this is effectively a new feature because '.mm' has never 
worked, and there is an easy workaround (monkey patching the compiler class).

And writing this I agree that this patch should not be back ported.

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



[issue33974] _stringify handles quoted strings incorrectly

2018-06-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

How did you find this bug?

--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33873] False positives when running leak tests with -R 1:1

2018-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7544

___
Python tracker 

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



[issue33718] Enhance regrtest: meta-ticket for multiple changes

2018-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7545

___
Python tracker 

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



[issue33873] False positives when running leak tests with -R 1:1

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d1f9481b7a2d31c40fca1347ef99d819eb656ce7 by Victor Stinner in 
branch '3.7':
bpo-33873: Backport regrtest from master to 3.7 (GH-7935)
https://github.com/python/cpython/commit/d1f9481b7a2d31c40fca1347ef99d819eb656ce7


--

___
Python tracker 

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



[issue33718] Enhance regrtest: meta-ticket for multiple changes

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d1f9481b7a2d31c40fca1347ef99d819eb656ce7 by Victor Stinner in 
branch '3.7':
bpo-33873: Backport regrtest from master to 3.7 (GH-7935)
https://github.com/python/cpython/commit/d1f9481b7a2d31c40fca1347ef99d819eb656ce7


--

___
Python tracker 

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



[issue33718] Enhance regrtest: meta-ticket for multiple changes

2018-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7547

___
Python tracker 

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



[issue33873] False positives when running leak tests with -R 1:1

2018-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7546

___
Python tracker 

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



[issue24567] random.choice IndexError due to double-rounding

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

The error goes avoid if we stop using floating point number to generate random 
integers. Can't we drop/deprecate support of RNG only providing getrandom() but 
not getrandbits()? I'm talking about the master branch.

Things are simpler when you only manipulate integers...

--

___
Python tracker 

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



[issue33718] Enhance regrtest: meta-ticket for multiple changes

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5430c14aba319f83b18879575244ba429e8c1d81 by Victor Stinner in 
branch '2.7':
[2.7] bpo-33873: Backport regrtest from master (GH-7936)
https://github.com/python/cpython/commit/5430c14aba319f83b18879575244ba429e8c1d81


--

___
Python tracker 

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



[issue33873] False positives when running leak tests with -R 1:1

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5430c14aba319f83b18879575244ba429e8c1d81 by Victor Stinner in 
branch '2.7':
[2.7] bpo-33873: Backport regrtest from master (GH-7936)
https://github.com/python/cpython/commit/5430c14aba319f83b18879575244ba429e8c1d81


--

___
Python tracker 

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



[issue24567] random.choice IndexError due to double-rounding

2018-06-26 Thread Tim Peters


Tim Peters  added the comment:

Victor, look at Raymond's patch.  In Python 3, `randrange()` and friends 
already use the all-integer `getrandbits()`.  He's changing three other lines, 
where some variant of `int(random() * someinteger)` is being used in an inner 
loop for speed.

Presumably the

return int(random() * n)

line in the `n >= maxsize` branch of `_randbelow_without_getrandbits()` should 
also get clamped.

--

___
Python tracker 

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



[issue33929] test_multiprocessing_spawn: WithProcessesTestProcess.test_many_processes() leaks 5 handles on Windows

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-33966: 
test_multiprocessing_spawn.WithProcessesTestPool.test_traceback() leaks 4 
handles on Windows.

--

___
Python tracker 

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



[issue5978] cProfile and profile don't work with pygtk/pyqt and sys.exit(0)

2018-06-26 Thread Andrés Delfino

Change by Andrés Delfino :


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



[issue5978] cProfile and profile don't work with pygtk/pyqt and sys.exit(0)

2018-06-26 Thread Andrés Delfino

Change by Andrés Delfino :


--
nosy: +adelfino
versions: +Python 2.7, 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



[issue24567] random.choice IndexError due to double-rounding

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

Let me see random_double_round.diff.

In master:

def shuffle(self, x, random=None):
"""Shuffle list x in place, and return None.

Optional argument random is a 0-argument function returning a
random float in [0.0, 1.0); if it is the default None, the
standard random.random will be used.

"""

This method has a weird API. What is the point of passing a random function, 
whereas shuffle() is already a method of an object which generates random 
numbers?! The bug only affects the case when random is set. I proposed to 
deprecate this argument and remove it later.

return [population[_min(_int(random() * total), total)]
for i in range(k)]

Why not using _randbelow() here? For speed according to:

> some variant of `int(random() * someinteger)` is being used in an inner loop 
> for speed.

Why not optimizing _randbelow() in this case? Like implementing it in C?

--

___
Python tracker 

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



[issue33873] False positives when running leak tests with -R 1:1

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1d55888a78bcefed3723fb7e48df2a75b4f0adb0 by Victor Stinner in 
branch '3.6':
bpo-33873: Backport regrtest from master to 3.7 (GH-7935) (GH-7937)
https://github.com/python/cpython/commit/1d55888a78bcefed3723fb7e48df2a75b4f0adb0


--

___
Python tracker 

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



[issue33718] Enhance regrtest: meta-ticket for multiple changes

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1d55888a78bcefed3723fb7e48df2a75b4f0adb0 by Victor Stinner in 
branch '3.6':
bpo-33873: Backport regrtest from master to 3.7 (GH-7935) (GH-7937)
https://github.com/python/cpython/commit/1d55888a78bcefed3723fb7e48df2a75b4f0adb0


--

___
Python tracker 

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



[issue33873] False positives when running leak tests with -R 1:1

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

Pablo Galindo Salgado fixed the bug in master, I backported his fix to 2.7, 3.6 
and 3.7 branches. Thanks Pablo!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 2.7, 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



[issue25007] Add support of copy protocol to zlib compressors and decompressors

2018-06-26 Thread Zackery Spytz


Change by Zackery Spytz :


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



[issue25007] Add support of copy protocol to zlib compressors and decompressors

2018-06-26 Thread Zackery Spytz


Change by Zackery Spytz :


--
nosy: +ZackerySpytz
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue33966] test_multiprocessing_spawn.WithProcessesTestPool.test_traceback() leaks 4 handles on Windows

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

* Pool._repopulate_pool() creates processes with args=(self._inqueue, ...)
* Pool._inqueue is a multiprocessing.queues.SimpleQueue
* Process.__init__() of multiprocessing.popen_spawn_win32 calls 
reduction.dump(process_obj, to_child) which indirectly contains the SimpleQueue
* A SimpleQueue object contains: self._reader, self._writer = 
connection.Pipe(duplex=False)
* dump() indirectly calls reduce_connection() (ex: for SimpleQueue._reader) of 
multiprocessing.connection
* reduce_connection() duplicates the pipe handle

It's unclear to me who is supposed to close the duplicated pipe handles? 
reduce_connection() creates a "ds = resource_sharer.DupSocket(s)" object, but 
this object doesn't seem to call CloseHandle()?

--

___
Python tracker 

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



[issue24567] random.choice IndexError due to double-rounding

2018-06-26 Thread Tim Peters


Tim Peters  added the comment:

[Victor]
> This method [shuffle()] has a weird API. What is
> the point of passing a random function,
> ... I proposed to deprecate this argument and remove it later.

I don't care here.  This is a bug report.  Making backward-incompatible API 
changes does nothing to repair existing programs.

> ...
>  return [population[_min(_int(random() * total), total)]
>for i in range(k)]
>
> Why not using _randbelow() here? For speed

Yup.


> Why not optimizing _randbelow() in this case? Like
> implementing it in C?

This is a bug report, not an invitation to redesign APIs and complicate 
implementations in non-trivial ways.  If you're keen on that, I suggest opening 
a different issue and writing the patch.

I'd personally oppose the API change (pointless thrashing), but it's possible 
the speed benefit of C acceleration of _randbelow() would outweigh the 
considerable downsides of moving code from Python source to C source.

But none of that is needed to "fix the bug" at hand, if - indeed - people still 
think it's worth fixing at all.  In the years that have passed since this 
started, I no longer do.

--

___
Python tracker 

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



[issue33917] Fix and document idlelib/idle_test/template.py

2018-06-26 Thread Ned Deily


Ned Deily  added the comment:

FTR, the problem change was merged/backported after 3.7.0rc1 and 3.6.6rc1 so 
doko must have been working from a development branch and not a release tag.  
The original and its fix will first be officially released in 3.7.1 and 3.6.7 
so there's really no need for a correction NEWS entry; it doesn't hurt either.

--
priority: release blocker -> 

___
Python tracker 

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



[issue33966] test_multiprocessing_spawn.WithProcessesTestPool.test_traceback() leaks 4 handles on Windows

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

> * dump() indirectly calls reduce_connection() (ex: for SimpleQueue._reader) 
> of multiprocessing.connection
> * reduce_connection() duplicates the pipe handle

Sorry, it's reduce_pipe_connection(), not reduce_connection().

> It's unclear to me who is supposed to close the duplicated pipe handles? 
> reduce_connection() creates a "ds = resource_sharer.DupSocket(s)" object, but 
> this object doesn't seem to call CloseHandle()?

reduce_pipe_connection() creates a DupHandle object which duplicates the 
handle, and it's detach() method closes the handle.

The race condition is that sometimes the pool terminates a worker (worker() 
function of multiprocessing.pool) before the worker has time to close the 
duplicated handle.

The handle is closed by:
* rebuild_pipe_connection()
* dh.detach(), extract:

return _winapi.DuplicateHandle(
proc, self._handle, _winapi.GetCurrentProcess(),
self._access, False, _winapi.DUPLICATE_CLOSE_SOURCE)

--

___
Python tracker 

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



[issue33973] HTTP request-line parsing splits on Unicode whitespace

2018-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

isspace() is also true for another non-ASCII character: U+0085 (b'\x85').

>>> ''.join(chr(i) for i in range(256) if chr(i).isspace())
'\t\n\x0b\x0c\r\x1c\x1d\x1e\x1f \x85\xa0'

--

___
Python tracker 

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



[issue24137] Force not using _default_root in IDLE

2018-06-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The net effect of this issue:

pyshell.main calls NoDefaultRoot() when running normally, when using a 
subprocess and testing is not set.  It does not call it when in -n mode since 
that would affect users.

idle_test.htest  calls NoDefaultRoot() unconditionally.  pyshell.main is not 
called.

test.test_idle sets testing to avoid the call when run by test.regrtest, to 
avoid failing the latter's changed-environment check.  But it does call 
NoDefaultRoot when run as __main__ and the tests are run by unittest.main.

Known dependencies on a default root have been removed.  It is unlikely that 
any are left.

--

___
Python tracker 

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



[issue33975] IDLE: only adjust DPI before Tk()

2018-06-26 Thread Terry J. Reedy


New submission from Terry J. Reedy :

#33656 patched PyShell to call SetProcessDpiAwareness on Windows nearly first 
thing, *at module level*, well before calling tkinter.Tk().  The Microsoft docs 
warn that making the Windows API call after starting the graphics system may 
not work as expected.  With tk 8.6,8, the result is sharp, but small type -- 
perhaps 7 points instead of 10.  This issue is about avoiding type shrinkage, 
both when running the htest suite as a whole and when running the test for an 
individual file after running the unittests.

To do that in any process, pyshell must be imported before Tk() is called.  The 
patch adds the following to htest.py.
import idlelib.pyshell  # Set Windows DPI awareness before Tk().

I will add the same where needed to the top of if __name__ == '__main__': 
clauses in idlelib modules, before running unittests.

--
assignee: terry.reedy
components: IDLE
messages: 320531
nosy: terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: IDLE: only adjust DPI before Tk()
type: behavior
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



[issue33956] update vendored expat to 2.2.5

2018-06-26 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 4e21100fa7bf66e0b32146d3f46ae16afc73fee1 by Benjamin Peterson in 
branch 'master':
bpo-33956: update vendored expat to 2.2.5 (GH-7925)
https://github.com/python/cpython/commit/4e21100fa7bf66e0b32146d3f46ae16afc73fee1


--

___
Python tracker 

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



[issue33956] update vendored expat to 2.2.5

2018-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7550

___
Python tracker 

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



[issue33956] update vendored expat to 2.2.5

2018-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7551

___
Python tracker 

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



[issue33956] update vendored expat to 2.2.5

2018-06-26 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
pull_requests: +7552

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2018-06-26 Thread Ned Deily


Ned Deily  added the comment:


New changeset e7d3cccd8e0da93a15ca80f4b6aac2ca3435fd06 by Ned Deily in branch 
'master':
bpo-29514: Make magic number test work for candidates
https://github.com/python/cpython/commit/e7d3cccd8e0da93a15ca80f4b6aac2ca3435fd06


--
nosy: +ned.deily

___
Python tracker 

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



[issue33975] IDLE: adjust DPI before Tk()

2018-06-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: IDLE: only adjust DPI before Tk() -> IDLE: adjust DPI before Tk()

___
Python tracker 

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



[issue33956] update vendored expat to 2.2.5

2018-06-26 Thread miss-islington


miss-islington  added the comment:


New changeset fb17b81fc90cb8f64fcffbada2cadb6736f6d7fd by Miss Islington (bot) 
in branch '3.7':
bpo-33956: update vendored expat to 2.2.5 (GH-7925)
https://github.com/python/cpython/commit/fb17b81fc90cb8f64fcffbada2cadb6736f6d7fd


--
nosy: +miss-islington

___
Python tracker 

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



[issue33956] update vendored expat to 2.2.5

2018-06-26 Thread miss-islington


miss-islington  added the comment:


New changeset 5dc3f23b5fb0b510926012cb3732dae63cddea60 by Miss Islington (bot) 
in branch '3.6':
bpo-33956: update vendored expat to 2.2.5 (GH-7925)
https://github.com/python/cpython/commit/5dc3f23b5fb0b510926012cb3732dae63cddea60


--

___
Python tracker 

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



[issue33975] IDLE: adjust DPI before Tk()

2018-06-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +7553

___
Python tracker 

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



[issue33975] IDLE: adjust DPI before Tk()

2018-06-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Because of import caching, subsequent pyshell imports, after the first, do not 
re-call the Windows API.

Apparently, 'root.destroy()' undoes a previous 'root = Tk()', but not a 
previous pyshell import.  Since IDLE unittests always destroy roots, a unittest 
before an htest does not require anything more to work right.

Since part of the purpose of human-viewed tests is to determine that widgets 
look right, it is important that they look the same for testing
as when running IDLE.

--

___
Python tracker 

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



[issue33975] IDLE: adjust DPI before Tk() for htests.

2018-06-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: IDLE: adjust DPI before Tk() -> IDLE: adjust DPI before Tk() for htests.

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2018-06-26 Thread Ned Deily


Ned Deily  added the comment:


New changeset 8511b448a55929f15aa5730c9e30cbb654978ea4 by Ned Deily in branch 
'3.7':
bpo-29514: Make magic number test work for candidates
https://github.com/python/cpython/commit/8511b448a55929f15aa5730c9e30cbb654978ea4


--

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2018-06-26 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +7554

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2018-06-26 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +7555

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2018-06-26 Thread Ned Deily


Ned Deily  added the comment:


New changeset f79386f669c22199e3ce99cfba2e5945c73beb47 by Ned Deily in branch 
'2.7':
bpo-29514: Make magic number test work for candidates (GH-7946)
https://github.com/python/cpython/commit/f79386f669c22199e3ce99cfba2e5945c73beb47


--

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2018-06-26 Thread Ned Deily


Ned Deily  added the comment:


New changeset 57389dbaa897fadc97de78af67d5e555e28be60b by Ned Deily in branch 
'3.6':
bpo-29514: Make magic number test work for candidates (GH-7945)
https://github.com/python/cpython/commit/57389dbaa897fadc97de78af67d5e555e28be60b


--

___
Python tracker 

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



[issue33956] update vendored expat to 2.2.5

2018-06-26 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 468f97b4640e69b237a707a0ef9152d1c023f701 by Benjamin Peterson in 
branch '2.7':
[2.7] closes bpo-33956: update vendored expat to 2.2.5 (GH-7925)
https://github.com/python/cpython/commit/468f97b4640e69b237a707a0ef9152d1c023f701


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



[issue32475] Add ability to query number of buffered bytes available on buffered I/O

2018-06-26 Thread Josh Snyder


Change by Josh Snyder :


--
pull_requests: +7556
stage:  -> patch review

___
Python tracker 

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



[issue33976] Enums don't support nested classes

2018-06-26 Thread Edward Wang


New submission from Edward Wang :

Methods defined in Enums behave 'normally' but classes defined in Enums get 
mistaken for regular values and can't be used as classes out of the box.

```python
class Outer(Enum):
a = 1
b = 2
class Inner(Enum):
foo = 10
bar = 11
```

--
messages: 320541
nosy: edwardw
priority: normal
severity: normal
status: open
title: Enums don't support nested classes
type: behavior

___
Python tracker 

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



[issue32475] Add ability to query number of buffered bytes available on buffered I/O

2018-06-26 Thread Josh Snyder


Josh Snyder  added the comment:

I've opened PR #7947 with another approach to this issue.

In my use-case, an HTTP client makes a request and uses buffered I/O to parse 
the response headers. I would like to hand off the response socket to an 
extension module for use with raw I/O syscalls. The BufferedReader likely 
already contains some of the response body, which I would like to access before 
handing the socket off.

--
nosy: +josnyder

___
Python tracker 

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



[issue33976] Enums don't support nested classes

2018-06-26 Thread Edward Wang


Change by Edward Wang :


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

___
Python tracker 

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



[issue33975] IDLE: adjust DPI before Tk() for htests.

2018-06-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 3c8043d8fac4c0d05c0ba9e4e555e2f3165f2fe0 by Terry Jan Reedy in 
branch 'master':
bpo-33975: Avoid small type when running IDLE's htests. (GH-7944)
https://github.com/python/cpython/commit/3c8043d8fac4c0d05c0ba9e4e555e2f3165f2fe0


--

___
Python tracker 

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



[issue33975] IDLE: adjust DPI before Tk() for htests.

2018-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7559

___
Python tracker 

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



[issue33975] IDLE: adjust DPI before Tk() for htests.

2018-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7560

___
Python tracker 

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



  1   2   >