[issue9699] invalid call of Windows API _popen() generating The input line is too long error message

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable

2019-04-27 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

So what's the relation between _PyRuntime and PyInterpreterState? If the latter 
is a structure per interpreter, what's the point of also making the former per 
interpreter? It would be better to move data from _PyRuntime to 
PyInterpreterState.

--

___
Python tracker 

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



[issue10071] Should not release GIL while running RegEnumValue

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue17148] mingw: nt thread model detection

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue21536] extension built with a shared python cannot be loaded with a static python

2019-04-27 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

Thanks for fixing the regression Victor.

Here is another potential problem.

On Android API 24 built with NDK r19, symbol resolution fails in the _socket 
shared library after changeset 8c3ecc6bacc8d0cd534f2b5b53ed962dd1368c7b when 
python is built with '--enable-shared':

  generic_x86_64:/data/local/tmp/python $ python -c "import _socket"
  Traceback (most recent call last):
File "", line 1, in 
  ImportError: dlopen failed: cannot locate symbol "PyByteArray_Type" 
referenced by 
"/data/local/tmp/python/lib/python3.8/lib-dynload/_socket.cpython-38d.so"...

This does not happen when the build is configured without '--enable-shared'.

An NDK issue [1] reports the same problem and dimitry in this issue explains 
that on Android >= 23 the shared library must be linked against the shared 
library where the symbol is defined. Dimitry says that the Android loader was 
fixed in M (i.e. API 23) and it must refer to the changes listed in the 
"RTLD_LOCAL (Available in API level >= 23)" section of "Android changes for NDK 
developers" [2].

[1] https://github.com/android-ndk/ndk/issues/201
[2] 
https://android.googlesource.com/platform/bionic/+/android-n-mr2-preview-1/android-changes-for-ndk-developers.md

--

___
Python tracker 

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



[issue5879] multiprocessing example "pool of http servers " fails on windows

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue1776160] Buffer overflow when listing deeply nested directory

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue17362] enable-new-dtags only for GNU ELF linker

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue900092] hotshot.stats.load fails with AssertionError

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue15907] move doctest test-data files into a subdirectory of Lib/test

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue13123] bdist_wininst uninstaller does not remove pycache directories

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue16663] Poor documentation for METH_KEYWORDS

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue4609] Allow use of > 256 FD's on solaris in 32 bit mode

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue13819] _warnings settings are process-wide

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue15106] Potential Bug in errors.c

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue17924] Deprecate stat.S_IF* integer constants

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue11212] Python memory limit on AIX

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue12480] urllib2 doesn't use proxy (fieddler2), configed the proxy with ProxyHandler

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue21956] Doc files deleted from repo are not deleted from docs.python.org.

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue14149] argparse: Document how to use argument names that are not Python identifiers

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue14730] Implementation of the PEP 419: Protecting cleanup statements from interruptions

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue10551] mimetypes read from the registry should not overwrite standard mime mappings

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue11455] issue a warning when populating a CPython type dict with non-string keys

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue17026] pdb frames accessible after the termination occurs on uncaught exception

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue9399] Provide a 'print' action for argparse

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue36722] In debug build, load also C extensions compiled in release mode or compiled using the stable ABI

2019-04-27 Thread Paul Ganssle


Change by Paul Ganssle :


--
pull_requests: +12905

___
Python tracker 

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



[issue809846] bdist_wininst doesn't clean up read-only files in build dir

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue9274] code.InteractiveInterpreter fails to change locals when invoked in a function

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue6029] FAIL: test_longdouble (ctypes.test.test_callbacks.Callbacks) [SPARC/64-bit]

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue17783] run the testsuite in batched mode

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue36546] Add quantiles() to the statistics module

2019-04-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for propelling this forward :-)  I'm really happy to have an easy to 
reach tool that readily summarizes the shape of data and that can be used to 
compare how distributions differ.


> Octave and Maple call their parameter "method", so if we 
> stick with  "method" we're in good company.

The Langford paper also uses the word "method", so that is likely just the 
right word.


> I'm more concerned about the values taken by the method parameter.
> "Inclusive" and "Exclusive"h ave a related but distinct meaning 
> when it comes to quartiles which is different from the Excel usage

Feel free to change it to whatever communicates the best.  The meaning I was 
going for is closer to the notions of open-interval or closed interval.  In 
terms of use cases, one is for describing population data where the minimum 
input really is the 0th percentile and the maximum is the 100th percentile.  
The other is for sample data where the underlying population will have values 
outside the range of the empirical samples.  I'm not sure what words bests 
describe the distinction.  The word "inclusive" and "exclusive" approximated 
that idea but maybe you can do better.


> I have a working version of quantiles() which supports cutpoints 
> and all nine calculation methods supported by R.

My recommendation is to not do this.  Usually, it's better to start simple, 
focusing on core use cases (i.e. sample and population), then let users teach 
us what additions they really need (this is a YAGNI argument).  Once a feature 
is offered, it can never be taken away even if it proves to be not helpful in 
most situations or is mostly unused.

In his 20 year retrospective, Hyndman expressed dismay that his paper had the 
opposite effect of what was intended (hoping for a standardization on a single 
approach rather than a proliferation of all nine methods).  My experience in 
API design is that offering users too many choices will complicate their lives, 
leading to suboptimal and incorrect choices and creating confusion.   That is 
likely why most software packages other than R only offer one or two options.

If you hold off, you can always add these options later.  We might just find 
that what we've got suffices for most everyday uses.   Also, I thought the 
spirit of the statistics module was to offer a few core statistical tools aimed 
at non-experts, deferring to external packages for more rich collections of 
optimized, expert tools that cover every option.  For me, the best analogy is 
my two cameras. One is a point and shoot that is easy to use and does a 
reasonable job. The other is a professional SLR with hundreds of settings that 
I had to go to photography school to learn to use.

FWIW, I held-off on adding "cut_points" because the normal use case is to get 
equally spaced quantiles.  It would be unusual to want 0.25 and 0.50 but not 
0.75.   The other reason is that user provided cut-points conflict with core 
concept of "Divide *dist* into *n* continuous intervals with equal 
probability."  User provided cut-points provide other ways to go wrong as well 
(not being sorted, 0.0 or 1.0 not being valid for some methods, values outside 
the range 0.0 to 1.0).  The need for cut_points makes more sense for numpy or 
scipy where is common to pass around a linspace. Everyday Python isn't like 
that.

--

___
Python tracker 

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



[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue16807] argparse group nesting lost on inheritance

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue18188] ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue36737] Warnings operate out of global runtime state.

2019-04-27 Thread Eric Snow


New submission from Eric Snow :

(See Include/internal/pycore_warnings.h and Python/_warnings.c.)

The warnings module's state (filters, default action, etc.) is currently stored 
at the level of the global runtime.  That's a problem for the following reasons:

* Python objects are getting stored in _PyRuntimeState
* it breaks the isolation of behavior between interpreters
* objects are leaking between interpreters
* importing the module in a subinterpreter effectively resets the module's state

While those are all a problem in a future where interpreters don't share the 
GIL, that last one is a problem right now for people using subinterpreters.

One of the following should happen:

* move warnings state down to PyInterpreterState
* move warnings state into PyInterpreterState.dict
* use the module-state API (PEP 3121)
* just work out of the module's __dict__

I could also see use cases for *also* configuring warnings process-wide but 
that could be handled separately if actually desired.

--
components: Interpreter Core
messages: 340951
nosy: brett.cannon, eric.snow, steve.dower
priority: normal
severity: normal
stage: needs patch
status: open
title: Warnings operate out of global runtime state.
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue15305] Test harness unnecessarily disambiguating twice

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue18675] Daemon Threads can seg fault

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue17695] _sysconfigdata broken with universal builds on OSX

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue15856] inspect.getsource(SomeClass) doesn't show @decorators

2019-04-27 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This should be resolved by issue35113 . I have rewritten the getsource function 
for classes to use AST to deal with nested classes. The PR adds support for 
showing the decorator in the source. I would propose closing this as a 
duplicate of the other issue.

--
nosy: +xtreak
versions: +Python 3.8 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue10328] re.sub[n] doesn't seem to handle /Z replacements correctly in all cases

2019-04-27 Thread Ma Lin


Ma Lin  added the comment:

This bug was fixed in Python 3.7, see issue32308.

Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit 
(Intel)] on win32
>>> re.compile('(?m)(?P[ 
>>> \t]+\r*$)|(?P(?<=[^\n])\Z)').subn(lambda m:next('<'+k+'>' 
>>> for k,v in m.groupdict().items() if v is not None), 'foobar ')
('foobar', 1)

Python 3.7.3rc1 (tags/v3.7.3rc1:69785b2127, Mar 12 2019, 22:37:55) [MSC v.1916 
64 bit (AMD64)] on win32
>>> re.compile('(?m)(?P[ 
>>> \t]+\r*$)|(?P(?<=[^\n])\Z)').subn(lambda m:next('<'+k+'>' 
>>> for k,v in m.groupdict().items() if v is not None), 'foobar ')
('foobar', 2)

--
nosy: +Ma Lin

___
Python tracker 

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



[issue4277] asynchat's handle_error inconsistency

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue1776160] Buffer overflow when listing deeply nested directory

2019-04-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Benjamin, what of the proposed options do you prefer?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue8138] wsgiref.simple_server.SimpleServer claims to be multithreaded

2019-04-27 Thread Berker Peksag


Berker Peksag  added the comment:

It's not easy to write a test for this, so I might merge PR 12977 without a 
test.

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

___
Python tracker 

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



[issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable

2019-04-27 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> It's wrong to share a single gc state between two interpreters

And what's your solution for that? I'm not asking for a complete 
ready-to-implement answer, but at least a basic idea. Otherwise it's impossible 
for me to judge whether your PR 12934 helps with that or not.

Basically I would like to see something like PEP 579 but for this problem.

--

___
Python tracker 

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



[issue10312] intcatcher() can deadlock

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue36679] duplicate method definition in Lib/test/test_genericclass.py

2019-04-27 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


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



[issue36736] Python crashes when calling win32file.LockFileEx

2019-04-27 Thread Anand Arumugam


New submission from Anand Arumugam :

Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32file
>>> import win32con
>>> import platform
>>> h = win32file.CreateFile(f'd:\\temp\\{platform.node()}.lock', 
>>> (win32file.GENERIC_READ | win32file.GENERIC_WRITE), 0, None, 
>>> win32con.CREATE_NEW, 0, None)
>>> win32file.LockFileEx(h, win32con.LOCKFILE_EXCLUSIVE_LOCK, 5, 5, None)

The moment I hit enter, python command prompt crashes. I'm unable to attach the 
crash dump file. If you cannot repro the crash, let me know.

--
assignee: terry.reedy
components: IDLE, Windows
messages: 340947
nosy: paul.moore, steve.dower, terry.reedy, tim.golden, yapydev, zach.ware
priority: normal
severity: normal
status: open
title: Python crashes when calling win32file.LockFileEx
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



[issue8988] import + coding = failure (3.1.2/win32)

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue7436] Define 'object with assignable attributes'

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue8041] No documentation for Py_TPFLAGS_HAVE_STACKLESS_EXTENSION or Py_TPFLAGS_HAVE_VERSION_TAG.

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue32642] add support for path-like objects in sys.path

2019-04-27 Thread Brett Cannon


Brett Cannon  added the comment:

This seems fine to me and I can't think of any negatives. Can anyone think of 
why this might be a bad idea? (Messing with how sys.path is used is just so 
fundamental I'm being paranoid. :)

--
nosy: +eric.snow, ncoghlan

___
Python tracker 

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



[issue36679] duplicate method definition in Lib/test/test_genericclass.py

2019-04-27 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

Thanks for fixing this!

--
nosy: +levkivskyi
resolution:  -> fixed
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



[issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable

2019-04-27 Thread Eric Snow


Eric Snow  added the comment:

FWIW, PEP 554 is part of a larger project that I've been working on (slowly) 
for several years now. [1]  The concrete objective is to leverage 
subinterpreters as the mechanism by which we can achieve multi-core parallelism 
in Python code.  Moving the GIL (and some other parts of _PyRuntimeState, as 
Victor indicated) down to per-interpreter state is essential to that.

However, I don't thing making _PyRuntime a per-interpreter thing is right.  The 
runtime holds the set of interpreters, as well as any state state shared by the 
interpreters.

Also, to be clear, the status quo is not a problem for me, so make sure I'm not 
used as the justification for the change (thoughtful as that is of Victor). :)


[1] https://github.com/ericsnowcurrently/multi-core-python

--

___
Python tracker 

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



[issue36735] minimize disk size of cross-compiled python3.6

2019-04-27 Thread Berker Peksag


Berker Peksag  added the comment:

Replying your second question: I think most Linux distributions strip the 
Lib/test/ directory, so it should be safe to just remove it. We don't refer to 
it from the standard library. The helpers documented at 
https://docs.python.org/3/library/test.html are only used by Lib/test.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue10328] re.sub[n] doesn't seem to handle /Z replacements correctly in all cases

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue35181] Doc: Namespace Packages: Inconsistent documentation of __loader__ being None

2019-04-27 Thread Brett Cannon


Change by Brett Cannon :


--
assignee: docs@python -> barry

___
Python tracker 

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



[issue21536] extension built with a shared python cannot be loaded with a static python

2019-04-27 Thread STINNER Victor


STINNER Victor  added the comment:

Xavier: would you be interested to work on a fix for Android?

--

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-04-27 Thread Stefan Behnel


Stefan Behnel  added the comment:

I implemented (most of) C14N 2.0 in issue 13611. Please give it a try if you 
are interested in the canonical serialisation feature. I would like to include 
it in Py3.8.

--

___
Python tracker 

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



[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2019-04-27 Thread Miro Hrončok

Miro Hrončok  added the comment:

Relevant NumPy issue: https://github.com/numpy/numpy/issues/13412

--
nosy: +hroncok

___
Python tracker 

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



[issue22640] Add silent mode for py_compile

2019-04-27 Thread Berker Peksag


Change by Berker Peksag :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue9521] xml.etree.ElementTree skips processing instructions when parsing

2019-04-27 Thread Stefan Behnel


Stefan Behnel  added the comment:

Comment/PI parsing in general is implemented in issue 36673. Note that there is 
currently no way to represent comments and PIs in the tree when they appear 
outside of the root element, which I think is what this ticket is about. After 
issue 36673 is resolved, however, they can at least be picked up from the 
parser target or from iterparse() and XMLPullParser().

--
versions: +Python 3.8 -Python 3.5

___
Python tracker 

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



[issue22029] argparse - CSS white-space: like control for individual text blocks

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue9643] urllib2 - Basic, Digest Proxy Auth Handlers failure will give 401 code instead of 407

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue17274] distutils silently omits relative symlinks

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue1047397] cgitb failures

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue11871] test_default_timeout() of test_threading.BarrierTests failure: BrokenBarrierError

2019-04-27 Thread David Bolen


David Bolen  added the comment:

I should mention that a high level of test parallelism on the part of my worker 
might have be a contributing factor in this most recent case.

The worker was recently upgraded to a faster 4-core VM, but with limited I/O.  
In a test run the test processes invariably end up stuck on I/O heavy tests, 
idling the CPUs.

So I've been running the tests under -j8, as I found it the most effective 
combination of supporting tests stuck on I/O while keeping the CPUs busy, but 
it does mean that in some cases there's a lot pending on the CPUs, and 
depending on the exact test ordering in a run presumably some more sensitive 
tests could be impacted.

I have in fact seen an increase in random tests generating warnings (fail, then 
pass) than the worker had previously.  I suspect the benefits of the extra 
parallelism on total test time (-j8 is about 20% faster than -j4) probably 
isn't valuable enough and will most likely be reducing it a bit.

--
nosy: +db3l

___
Python tracker 

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



[issue11001] Various obvious errors in cookies documentation

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue36739] "4.6. Defining Functions" should mention nonlocal

2019-04-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the suggestion.  Would you like to submit a PR?

--
keywords: +easy
nosy: +rhettinger
stage:  -> needs patch

___
Python tracker 

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



[issue13611] Integrate ElementC14N module into xml.etree package

2019-04-27 Thread Stefan Behnel


Stefan Behnel  added the comment:

It took me a couple of minutes longer to submit it, but it's there now. :)

I'm aware that there is a lot of new code involved, covering really three new 
features, which makes reviewing it a non-trivial task. I personally think it's 
ready to go into the last alpha release on Monday to receive some initial 
visibility, but I would like to have at least a little feedback before that. 
Even just a general opinion whether you support pushing this into 3.8 or not. 
Postponing it to the first beta would be ok, if you need more time to form an 
opinion, but having it in an alpha would improve the chance of getting user 
feedback.

--

___
Python tracker 

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



[issue21281] DEBUGGING: Simultaneous stopping of all threads on breakpoint and switching between threads

2019-04-27 Thread daniel hahler


daniel hahler  added the comment:

This is a good idea.

I am currently leaning towards using a threading.Lock around `Pdb.interaction`, 
or `pdb.set_trace` with pdb++.

This would at least mitigate the issue where `pdb.set_trace` is used in some 
code that gets executed again, and two pdb instances would use the same input, 
e.g. when debugging web applications.

See also https://bugs.python.org/issue23163 for/about improving docs in this 
regard.

--

___
Python tracker 

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



[issue36730] Change outdated references to macOS

2019-04-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I believe that this duplicates comments on other Mac issues.  The download web 
pages are not part of the CPython repository covered by this tracker.  I will 
let Ned comment further.

--
components: +macOS
nosy: +ned.deily, ronaldoussoren, terry.reedy -docs@python

___
Python tracker 

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



[issue36735] minimize disk size of cross-compiled python3.6

2019-04-27 Thread Stefan Behnel


Change by Stefan Behnel :


--
nosy:  -scoder

___
Python tracker 

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



[issue9643] urllib2 - Basic, Digest Proxy Auth Handlers failure will give 401 code instead of 407

2019-04-27 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This is still an issue and the relevant RFC part and a unittest would be as 
below. I would propose adding a new keyword argument with 401 as default value 
to ensure backwards compatibility with older versions. I can propose a PR if 
agreed and also improve test case since changing the hard coded status code 
from 401 to 407 doesn't seem to cause any failure.


https://tools.ietf.org/html/rfc7235#section-3.2

3.2.  407 Proxy Authentication Required

   The 407 (Proxy Authentication Required) status code is similar to 401
   (Unauthorized), but it indicates that the client needs to
   authenticate itself in order to use a proxy.  The proxy MUST send a
   Proxy-Authenticate header field (Section 4.3) containing a challenge
   applicable to that proxy for the target resource.  The client MAY
   repeat the request with a new or replaced Proxy-Authorization header
   field (Section 4.4).

unittest

diff --git a/Lib/test/test_urllib2_localnet.py 
b/Lib/test/test_urllib2_localnet.py
index 591b48d6d4..ab8dd32795 100644
--- a/Lib/test/test_urllib2_localnet.py
+++ b/Lib/test/test_urllib2_localnet.py
@@ -357,9 +357,9 @@ class ProxyAuthTests(unittest.TestCase):
 self.proxy_digest_handler.add_password(self.REALM, self.URL,
self.USER, self.PASSWD+"bad")
 self.digest_auth_handler.set_qop("auth")
-self.assertRaises(urllib.error.HTTPError,
-  self.opener.open,
-  self.URL)
+with self.assertRaises(urllib.error.HTTPError) as cm:
+self.opener.open(self.URL)
+self.assertEqual(cm.exception.code, 407)

 def test_proxy_with_no_password_raises_httperror(self):
 self.digest_auth_handler.set_qop("auth")

$ ./python.exe -m unittest -v 
test.test_urllib2_localnet.ProxyAuthTests.test_proxy_with_bad_password_raises_httperror
test_proxy_with_bad_password_raises_httperror 
(test.test_urllib2_localnet.ProxyAuthTests) ... FAIL

==
FAIL: test_proxy_with_bad_password_raises_httperror 
(test.test_urllib2_localnet.ProxyAuthTests)
--
Traceback (most recent call last):
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_urllib2_localnet.py",
 line 362, in test_proxy_with_bad_password_raises_httperror
self.assertEqual(cm.exception.code, 407)
AssertionError: 401 != 407

--
Ran 1 test in 0.160s

FAILED (failures=1)

--
nosy: +xtreak
versions: +Python 3.8 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue8138] wsgiref.simple_server.SimpleServer claims to be multithreaded

2019-04-27 Thread Berker Peksag


Change by Berker Peksag :


--
pull_requests: +12903

___
Python tracker 

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



[issue36742] urlsplit doesn't accept a NFKD hostname with a port number

2019-04-27 Thread Chihiro Ito


Change by Chihiro Ito :


--
type:  -> behavior

___
Python tracker 

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



[issue21281] DEBUGGING: Simultaneous stopping of all threads on breakpoint and switching between threads

2019-04-27 Thread daniel hahler


Change by daniel hahler :


--
nosy: +blueyed

___
Python tracker 

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



[issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls)

2019-04-27 Thread Dieter Maurer


Dieter Maurer  added the comment:

Terry J. Reedy wrote:
> SkipTest is an exception and according to the doc it should be propagated to 
> the caller.  __unittest_skip__ is an undocumented internal name, so you 
> probably should not be using it.
>
> If this request is not rejected, we will need test code demonstrating the 
> issue *that does not use zope*.

The "skip" I am speaking about is a decorator for tests or test classes telling 
a "runner" to skip tests (likely because conditions for their success are not 
met - usually, that required packages are not installed). This "skip" 
(decorator) uses `__unittest_skip__` to tell the  the "unittest runner" (that 
is `unittest.TestCase.run`) that the test should be skipped.

The "unittest runner" is extremely rudimentary and lacks many important 
features. That is why I use the much more feature rich `zope.testrunner`. I 
could implement the `__unittest_skip__` logic there - but as you wrote - this 
should remain encapsulated inside `unittest` (that's why I wrote this issue).

I attach a test script - which likely is not convincing as the feature is 
mainly important for a sophisticated test runner, not for explicit calls of 
`TestCase.debug`.

--
Added file: https://bugs.python.org/file48287/utest.py

___
Python tracker 

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



[issue36719] regrtest --findleaks should fail if an uncollectable object is found

2019-04-27 Thread STINNER Victor


Change by STINNER Victor :


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



[issue16425] minidom replaceChild(new_child, old_child) removes new_child even if in another document

2019-04-27 Thread Stefan Behnel


Stefan Behnel  added the comment:

Since "new_child" is inserted at least into a new place, it needs to be removed 
from its old place as well, so that part seems correct. The problem description 
does not make it clear whether or not "old_child" is handled correctly, but 
looking at the code (and lacking a complete example that shows an error), I 
cannot see anything wrong there.

I'll close this ticket since it has been idle for years and it is unclear to me 
from the description whether it is an actual misbehaviour or a misunderstanding 
of correct behaviour.

--
nosy: +scoder
resolution:  -> works for me
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



[issue36679] duplicate method definition in Lib/test/test_genericclass.py

2019-04-27 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

OK, backported the fix to 3.7.

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



[issue35070] test_posix fails on macOS 10.14 Mojave

2019-04-27 Thread Jeffrey Kintscher


Jeffrey Kintscher  added the comment:

The test fails for me on Mohave when I build using clang 10.0.0, but passes 
when I build using gcc 8.3.0.:

ProductName:Mac OS X
ProductVersion: 10.14.3
BuildVersion:   18D109

gcc-8 (Homebrew GCC 8.3.0) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
--with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

--
nosy: +websurfer5

___
Python tracker 

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



[issue36738] Add 'array_hook' for json module

2019-04-27 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> bob.ippolito
nosy: +bob.ippolito

___
Python tracker 

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



[issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable

2019-04-27 Thread Eric Snow


Eric Snow  added the comment:

I don't think this change is the right way to go (yet), but something related 
might be.  First, let's be clear on the status quo for CPython.  (This has 
gotten long, but I want to be clear.)


Status Quo


For simplicity sake, let's say nearly all the code operates relative to the 3 
levels of runtime state:

* global  - _PyRuntimeState
* interpreter - PyInterpreterState
* thread  - PyThreadState

Furthermore, there are 3 groups of functions in the C-API:

* context-sensitive   - operate relative to the current Python thread
* runtime-dependent   - operate relative to some part of the runtime state, 
regardless of thread
* runtime-independent - have nothing to do with CPython's runtime state

Most of the C-API is context-sensitive.  A small portion is runtime-dependent.  
A handful of functions are runtime-independent (effectively otherwise stateless 
helper functions that only happen to be part of the C-API).

Each context-sensitive function relies on there being a "runtime context" it 
can use relative to the current OS thread.  That context consists of the 
current (i.e. active) PyThreadState, the corresponding PyInterpreterState, and 
the global _PyRuntimeState.  That context is derived from data in TSS (see 
caveats below).  This group includes most of the C-API.

Each runtime-dependent function operates against one or more runtime state 
target, regardless of the current thread context (or even if there isn't one).  
The target state (e.g. PyInterpreterState) is always passed explicitly.  Again, 
this is only a small portion of the C-API.

Caveats:
* for context-sensitive functions, we get the global runtime state from the 
global C variable (_PyRuntime) rather than via the implicit thread context
* for some of the runtime-dependent functions that target _PyRuntimeState, we 
rely on the global C variable

All of this is the pattern we use currently.  Using TSS to identify the 
implicit runtime context has certain benefits and costs:

benefits:
* sticking with the status quo means no backward incompatibility for existing 
C-extension code
* easier to distinguish the context-sensitive functions from the 
runtime-dependent ones
* (debatable) callers don't have to track, nor pass through, an extra argument

costs:
* extra complexity in keeping TSS correct
* makes the C-API bigger (extra macros, etc.)


Alternative
=

For every context-sensitive function we could add a new first parameter, 
"context", that provides the runtime context to use.  That would be something 
like this:

struct {
PyThreadState *tstate;
...
} PyRuntimeContext;

The interpreter state and global runtime state would still be accessible via 
the same indirection we have now.

Taking this alternative would eliminate the previous costs.  Having a 
consistent "PyRuntimeContext *context" first parameter would maintain the easy 
distinction from runtime-dependent functions.  Asking callers to pass in the 
context explicitly is probably better regardless.  As to backward 
compatibility, we could maintain a shim to bridge between the old way and the 
new.


About the C-global _PyRuntime
==

Currently the global runtime state (_PyRuntimeState) is stored in a static 
global C variable, _PyRuntime.  I added it at the time I consolidated many of 
the existing C globals into a single struct.  Having a C global makes it easy 
to do the wrong thing, so it may be good to do something else.

That would mean allocating a _PyRuntimeState on the heap early in startup and 
pass that around where needed.  I expect that would not have any meaningful 
performance penalty.  It would probably also simplify some of the code we 
currently use to manage _PyRuntime correctly.

As a bonus, this would be important if we decided that 
multiple-runtimes-per-process were a desirable thing.  That's a neat idea, 
though I don't see a need currently.  So on its own it's not really a 
justification for dropping a static _PyRuntime. :)  However, I think the other 
reasons are enough.


Conclusions


This issue has a specific objective that I think is premature.  We have an 
existing pattern and we should stick with that until we decide to change to a 
new pattern.  That said, a few things should get corrected and we should 
investigate alternative patterns for the context-sensitive C-API.

As to getting rid of the _PyRuntime global variable in favor of putting it on 
the heap, I'm not opposed.  However, doing so should probably be handled in a 
separate issue.

Here are my thoughts on actionable items:

1. look for a better pattern for the context-sensitive C-API
2. clearly document which of the 3 groups each C-API function belongs to
3. add a "runtime" field to the PyInterpreterState pointing to the parent 
_PyRuntimeState
4. (maybe) add a _PyRuntimeState_GET() macro, a la PyThreadState_GET()
5. for context-sensitive C-API that uses the global runtime

[issue36675] Doctest directives and comments missing from code samples

2019-04-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I verified that the line in Doc/library/doctest.rst has the comment.
"
For example, this test passes::

   >>> print(list(range(20))) # doctest: +NORMALIZE_WHITESPACE
   [0,   1,  2,  3,  4,  5,  6,  7,  8,  9,
   10,  11, 12, 13, 14, 15, 16, 17, 18, 19]
"
However, the comment is omitted from the .html built on Windows by Sphinx 1.8.1.
"
>>> print(list(range(20))) 
   ***html for comment should be here***
[0,   1,  2,  3,  4,  5,  6,  7,  8,  9,
10,  11, 12, 13, 14, 15, 16, 17, 18, 19]


"
To me, this is a bug with building the .html for doctest.rst.  Comments are 
preserved elsewhere.  For instance, the code example for 
https://docs.python.org/3/library/functions.html#dir.  The .rst file has
"
   The resulting list is sorted alphabetically.  For example:

  >>> import struct
  >>> dir()   # show the names in the module namespace  # doctest: +SKIP
"
Both use 3-space colon + indents to mean 'example block'.  The only difference 
is '::' versus ':'.  https://devguide.python.org/documenting/#source-code says 
:: is required.  idle.rst also has a code example with comments displayed (I 
just submitted a PR to not suppress color highlighting.)

I leave it to the doc experts to discover why the comments are not included in 
doctest.html.

--
nosy: +eric.araujo, ezio.melotti, terry.reedy, willingc
stage:  -> needs patch
title: Doctest directives and comments not visible or missing from code samples 
-> Doctest directives and comments missing from code samples
versions: +Python 2.7, 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



[issue36738] Add 'array_hook' for json module

2019-04-27 Thread matt farrugia


New submission from matt farrugia :

The json module allows a user to provide an `object_hook` function, which, if 
provided, is called to transform the dict that is created as a result of 
parsing a JSON Object.

It'd be nice if there was something analogous for JSON Arrays: an `array_hook` 
function to transform the list that is created as a result of parsing a JSON 
Array.

At the moment transforming JSON Arrays requires one of the following approaches 
(as far as I can see):

(1) Providing an object_hook function that will recursively transform any lists 
in the values of an Object/dict, including any nested lists, AND recursively 
transforming the final result in the event that the top level JSON object being 
parsed is an array (this array is never inside a JSON Object that goes through 
the `object_hook` transformation).
(2) Transforming the entire parsed result after parsing is finished by 
recursively transforming any lists in the final result, including recursively 
traversing nested lists AND nested dicts.

Providing an array_hook would cut out the need for either approach, as the 
recursive case from the recursive functions I mentioned could be used as the 
`array_hook` function directly (without the recursion).


## An example of usage:

Let's say we want JSON Arrays represented using tuples rather than lists, e.g. 
so that they are hashable straight out-of-the-(json)-box. Before this 
enhancement, this change requires one of the two methods I mentioned above. It 
is not so difficult to implement these recursive functions, but seems 
inelegant. After the change, `tuple` could be used as the `array_hook` directly:

```
>>> json.loads('{"foo": [[1, 2], "spam", [], ["eggs"]]}', array_hook=tuple)
{'foo': ((1, 2), 'spam', (), ('eggs',))}
```

It seems (in my opinion) this is more elegant than converting via an 
`object_hook` or traversing the whole structure after parsing.

## The patch:

I am submitting a patch that adds an `array_hook` kwarg to the `json` module's 
functions `load` and `loads`, and to the `json.decoder` module's `JSONDecoder`, 
`JSONArray` and `JSONObject` classes. I also hooked these together in the 
`json.scanner` module's `py_make_scanner` function.


It seems that `json.scanner` will prefer the `c_make_scanner` function defined 
in `Modules/_json.c` when it is available. I am not confident enough in my C 
skills or C x Python knowledge to dive into this module and make the analogous 
changes. But I assume they will be simple for someone who can read C x Python 
code, and that the changes will be analogous to those required to 
`Lib/json/scanner.py`. I need help to accomplish this part of the patch.


## Testing:

In the mean time, I added a test to `test_json.test_decode`. It's CURRENTLY 
FAILING because the implementation of the patch is incomplete (I believe this 
is only due to the missing part of the patch---the required changes to 
`Modules/_json.c` I identified above).

When I manually reset `json.scanner.make_scanner` to 
`json.scanner.py_make_scanner` and play around with the new `array_hook` 
functionality, it seems to work.

--
components: Extension Modules, Library (Lib)
messages: 340957
nosy: matomatical
priority: normal
severity: normal
status: open
title: Add 'array_hook' for json module
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



[issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls)

2019-04-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

3.6 only gets security fixes.  This appears to be an enhancement request.  
SkipTest is an exception and according to the doc it should be propagated to 
the caller.  __unittest_skip__ is an undocumented internal name, so you 
probably should not be using it.

If this request is not rejected, we will need test code demonstrating the issue 
*that does not use zope*.

--
nosy: +terry.reedy
stage:  -> test needed
type: behavior -> enhancement
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



[issue22640] Add silent mode for py_compile

2019-04-27 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


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



[issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable

2019-04-27 Thread Steve Dower


Steve Dower  added the comment:

Changing every API to take the context parameter would bring us into alignment 
with the JavaScript VMs.

I'm working on a project that embeds a few of these, as well as Python, and our 
thread management is much worse than their context parameter. Though I'm of 
course very sympathetic to the compatibility argument (but then the shims would 
just load the context from TSS and pass it around, so they're not too bad).

Eric's breakdown of context scopes seems spot on, and it means that we only 
really need the thread state to be passed around. The few places that would be 
satisfied by runtime state now (GIL, GC) should become interpreter state, which 
is most easily found from a thread state anyway.

Runtime state should eventually probably become runtime configuration (those 
settings we need to create interpreters) and a minimum amount of state to track 
live interpreters. I see no reason to pass it around anywhere other than 
interpreter creation, and as a transitional step toward that goal it should be 
accessible through the active interpreter state.

--

___
Python tracker 

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



[issue36679] duplicate method definition in Lib/test/test_genericclass.py

2019-04-27 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:


New changeset d111490a1f63db2dcc3714157726dc6a5c0fa1cd by Ivan Levkivskyi in 
branch '3.7':
[3.7] bpo-36679: Rename duplicate test_class_getitem function (GH-12892) 
(GH-12978)
https://github.com/python/cpython/commit/d111490a1f63db2dcc3714157726dc6a5c0fa1cd


--

___
Python tracker 

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



[issue36742] urlsplit doesn't accept a NFKD hostname with a port number

2019-04-27 Thread Chihiro Ito

New submission from Chihiro Ito :

urllib.parse.urlsplit raises an exception for an url including a non-ascii 
hostname in NFKD form and a port number.

example:
>>> urlsplit('http://\u30d5\u309a:80')
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/ito/.maltybrew/deen/lib/python3.7/urllib/parse.py", line 437, in 
urlsplit
_checknetloc(netloc)
  File "/Users/ito/.maltybrew/deen/lib/python3.7/urllib/parse.py", line 407, in 
_checknetloc
"characters under NFKC normalization")
ValueError: netloc 'プ:80' contains invalid characters under NFKC normalization
>>> urlsplit('http://\u30d5\u309a')
SplitResult(scheme='http', netloc='プ', path='', query='', fragment='')
>>> urlsplit(unicodedata.normalize('NFKC', 'http://\u30d5\u309a:80'))
SplitResult(scheme='http', netloc='プ:80', path='', query='', fragment='')

I believe this behavior was introduced at Python 3.7.3. Python 3.7.2 doesn't 
raise any exception for these lines.

--
components: Unicode
messages: 340983
nosy: ezio.melotti, hokousya, vstinner
priority: normal
severity: normal
status: open
title: urlsplit doesn't accept a NFKD hostname with a port number
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



[issue36738] Add 'array_hook' for json module

2019-04-27 Thread matt farrugia


Change by matt farrugia :


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

___
Python tracker 

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



[issue36679] duplicate method definition in Lib/test/test_genericclass.py

2019-04-27 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
status: closed -> open

___
Python tracker 

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



[issue36740] zipimporter misses namespace packages for implicit dirs

2019-04-27 Thread Jason R. Coombs


New submission from Jason R. Coombs :

As discovered in https://github.com/pypa/packaging-problems/issues/212, if a 
PEP 420 namespace package is represented by an implicit directory (that is, 
there's no explicit entry for the directory, only entries for the contents of 
the directory), that directory won't be picked up as a namespace package. The 
following code illustrates the issue:

```
zp $ cat make-pkgs.py   

   
import zipfile


def make_pkgs():
zf = zipfile.ZipFile('simple.zip', 'w')
zf.writestr('pkg/__init__.py', b'')
zf.close()

zf = zipfile.ZipFile('namespace.zip', 'w')
zf.writestr('ns/pkg/__init__.py', b'')
zf.close()


__name__ == '__main__' and make_pkgs()
zp $ python make-pkgs.py

   
zp $ env PYTHONPATH=simple.zip python3.7 -c "import pkg"

   
zp $ env PYTHONPATH=namespace.zip python3.7 -c "import ns.pkg"  

   
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'ns'
```

As you can see, in simple.zip, the `pkg` directory is implied, but despite that 
condition, `pkg` is importable.

However, with namespace.zip, the name `ns` is not visible even though it's 
present in the zipfile and would be importable if that zipfile were extracted 
to a file system.

```
zp $ unzip namespace.zip
Archive:  namespace.zip
 extracting: ns/pkg/__init__.py
zp $ python3.7 -c "import ns.pkg" && echo done
done
```

If you were to reconstruct that zip file on the file system using standard 
tools or explicitly include 'ns/' in the zip entries, the namespace package 
becomes visible:

```
zp $ rm namespace.zip   

   
zp $ zip -r namespace.zip ns

   
  adding: ns/ (stored 0%)
  adding: ns/pkg/ (stored 0%)
  adding: ns/pkg/__init__.py (stored 0%)
  adding: ns/pkg/__pycache__/ (stored 0%)
  adding: ns/pkg/__pycache__/__init__.cpython-37.pyc (deflated 23%)
zp $ rm -r ns   

   
zp $ env PYTHONPATH=namespace.zip python3.7 -c "import ns.pkg" && echo done 

   
done
```

For consistency, the zip import logic should probably honor implicit 
directories in zip files.

--
components: Library (Lib)
messages: 340975
nosy: jaraco
priority: normal
severity: normal
status: open
title: zipimporter misses namespace packages for implicit dirs
type: behavior

___
Python tracker 

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



[issue10328] re.sub[n] doesn't seem to handle /Z replacements correctly in all cases

2019-04-27 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> out of date
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



[issue23163] pdb docs need to contain a statement on threads/multithreaded debugging

2019-04-27 Thread daniel hahler


Change by daniel hahler :


--
nosy: +blueyed

___
Python tracker 

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



[issue36739] "4.6. Defining Functions" should mention nonlocal

2019-04-27 Thread Peter Bauer


New submission from Peter Bauer :

In the fourth paragraph, the sentence 

"Thus, global variables cannot be directly assigned a value within a function 
(unless named in a global statement)"

should somehow be extended to mention the nonlocal-statements:

Thus, global variables or variables of enclosing functions cannot be directly 
assigned a value within a function (unless named in a global statement (for 
global variables) or named in a nonlocal statement (for variables of enclosing 
functions)

--
assignee: docs@python
components: Documentation
messages: 340963
nosy: docs@python, pbhd0815
priority: normal
severity: normal
status: open
title: "4.6. Defining Functions" should mention nonlocal
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue10789] Lock.acquire documentation is misleading

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2019-04-27 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue36694] Excessive memory use or memory fragmentation when unpickling many small objects

2019-04-27 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +inada.naoki

___
Python tracker 

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



  1   2   >