[issue21110] Slowdown and high memory usage when adding a new module in embedded Python 3.4 on 64bit Windows

2019-04-12 Thread Inada Naoki


Inada Naoki  added the comment:

Is this issue still alive?
May I close this issue as "out of date"?

--
nosy: +inada.naoki

___
Python tracker 

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



[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2019-04-12 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 9e4f2f3a6b8ee995c365e86d976937c141d867f8 by Inada Naoki in branch 
'master':
bpo-20180: Use argument clinic for dict.pop() and dict.popitem() (GH-12792)
https://github.com/python/cpython/commit/9e4f2f3a6b8ee995c365e86d976937c141d867f8


--

___
Python tracker 

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



[issue35279] asyncio uses too many threads by default

2019-04-12 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



[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-12 Thread Laurie Opperman


Laurie Opperman  added the comment:

> Is the behaviour you're proposing any different from using `Path.rglob('*')`?

By that logic, we should remove `Path.iterdir()` in favour of `Path.glob('*')`. 
In addition, having `iterdir` the way it is makes it easy for subclasses to 
extend its functionality (for example, one of my `Path` subclasses allows a 
callable to be passed to the `iterdir` which can filter paths)

> One thing you may need to worry about here is the fact that symlinks can have 
> cycles, so you may need to do some cycle detection to avoid creating the 
> dangerous possibility of infinite loops.

I agree, which is the main reason the current implementation in the 
pull-request is to not resolve symlinks: users can subclass and implement 
symlink resolving if they want

> There's also the question of whether you want this to be a depth-first or 
> breadth-first traversal, and whether you would want both of these to be 
> options.

As much as I want to say that I don't see a use-case for breadth-first file 
listing (when I list files, I expect the next file provided to be 'next to' the 
current file), users currently have no standard-library functionality to 
perform breadth-first searches as far as I know: they'd have to implement it 
themself or find it in a third-party library

> Slightly related, pathlib.walk was proposed in the past in python-ideas...

I've never really liked the interface to `walk`, personal preference

--

___
Python tracker 

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



[issue35279] asyncio uses too many threads by default

2019-04-12 Thread Laurie Opperman


Laurie Opperman  added the comment:

What about making it dependant on memory as well as logical processor count:

`n_workers = min(RAM_GB / some_number, N_CORES * 5)`

--
nosy: +Epic_Wink

___
Python tracker 

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



[issue36609] activate.ps1 in venv for Windows should encoded with BOM

2019-04-12 Thread 정한솔

New submission from 정한솔 :

"activate.ps1" (venv) is currently encoded as UTF8 without BOM. But this cause 
an error if path of an environment contains non-ASCII characters. It seems 
Powershell can't recognize UTF8 without BOM. If I changed encoding of 
activate.ps1 to UTF8-BOM, it works well.

So I think activate.ps1 should be encoded as UTF8-BOM.

https://stackoverflow.com/questions/14482253/utf8-script-in-powershell-outputs-incorrect-characters

--
messages: 340014
nosy: 정한솔
priority: normal
severity: normal
status: open
title: activate.ps1 in venv for Windows should encoded with BOM
type: crash
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue35279] asyncio uses too many threads by default

2019-04-12 Thread Inada Naoki


Inada Naoki  added the comment:

node.js default threadpool size is 4 regardless number of cores.
https://nodejs.org/api/cli.html#cli_uv_threadpool_size_size

Since we has GIL, I think fixed-size pool is better idea.

--

___
Python tracker 

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



[issue36579] test_venv: test_with_pip() hangs on PPC64 AIX 3.x

2019-04-12 Thread Michael Felt


Michael Felt  added the comment:

On 10/04/2019 18:49, STINNER Victor wrote:
> STINNER Victor  added the comment:
>
> "I am looking into this - but as it seems to have gone away again - is
> there a simple way to get that code back, and/or see what the diff is,
> before/badrun/after?"
>
> Maybe it's just a flacky test. It's hard to guess.
>
> You can get the Git revision of a build by looking at details:
>
> https://buildbot.python.org/all/#/builders/10/builds/2389
> => Properties: "got_revision: 8702b67dad62a9084f6c1823dce10653743667c8"
>
> See also "Changes" tab.
>
> Sometimes when a bug disappears, I just close it as "outdated" after a few 
> weeks.
>
> --
>
> ___
> Python tracker 
> 
> ___
>
I'll try a manual build on the gccfarm. Not exactly the same
environment, but as close as I can get.

--

___
Python tracker 

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



[issue36609] activate.ps1 in venv for Windows should encoded with BOM

2019-04-12 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
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



[issue17267] datetime.time support for '+' and '-'

2019-04-12 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue36610] os.sendfile can return EINVAL on Solaris

2019-04-12 Thread Jakub Kulik


New submission from Jakub Kulik :

Hi,

We have several tests failing on Solaris due to the slightly different behavior 
of os.sendfile function. Sendfile on Solaris can raise EINVAL if offset is 
equal or bigger than the size of the file (Python expects that it will return 0 
bytes sent in that case).

I managed to patch `socked.py` with additional checks on two places (patch 
attached), Python 3.8 introduced sendfile in shutil.py module, where I don't 
have fsize variable so easily accessible and so I am unsure what to do with it. 
Also, I am not even sure if this is a correct way to handle this. Maybe this 
should be patched somewhere in the .c file? Or there might be other systems 
with the same behavior and all I need to do is adjust some define guards 
there...

EINVAL can also mean other things and so I guess I cannot just catch that errno 
and continue as with returned 0. 

Thanks

--
components: Library (Lib)
files: sendfile.patch
keywords: patch
messages: 340017
nosy: kulikjak
priority: normal
severity: normal
status: open
title: os.sendfile can return EINVAL on Solaris
type: crash
versions: Python 3.7, Python 3.8
Added file: https://bugs.python.org/file48262/sendfile.patch

___
Python tracker 

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



[issue36598] mock side_effect should be checked for iterable not callable

2019-04-12 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks, I am closing this as not a bug. Feel free to reopen this if I have 
missed any.

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



[issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint

2019-04-12 Thread STINNER Victor


New submission from STINNER Victor :

When PYTHONMALLOC=debug environment variable or -X dev command line option is 
used, Python installs debug hooks on memory allocators which add 2 size_t 
before and 2 size_t after each memory block: it adds 32 bytes to every memory 
allocation.

I'm debugging crashes and memory leaks in CPython for 10 years, and I simply 
never had to use "serialno". So I simply propose attached pull request to 
remove it to reduce the memory footprint: I measured a reduction around -5% 
(ex: 1.2 MiB on 33.0 MiB when running test_asyncio). A smaller memory footprint 
allows to use this feature on devices with small memory, like embedded devices.

The change also fix race condition in debug memory allocators: bpo-31473, 
"Debug hooks on memory allocators are not thread safe (serialno variable)".

Using tracemalloc, it is already possible (since Python 3.6) to find where a 
memory block has been allocated, and so decide where to put a breakpoint when 
debugging.

If someone cares about the "serialno" field, maybe we can keep code using a 
compilation flag, like a C #define.

"serialno" is documented as: "an excellent way to set a breakpoint on the next 
run, to capture the instant at which this block was passed out." But again, I 
never used it...

--

Some examples of the *peak* memory usage without => with the change:

* -c pass: 2321.8 kB => 2437.1 kB (-115.3 kiB, -5%)
* -m test test_os test_sys: 14252.3 kB => 13598.6 kB (-653.7 kiB, -5%)
* -m test test_asyncio: 34194.2 kB => 32963.1 kB (-1231.1 kiB, -4%)

Command used to measure the memory consumption:

$ ./python -i -X tracemalloc -c pass
>>> import tracemalloc; print("%.1f kB" % (tracemalloc.get_traced_memory()[1] / 
>>> 1024.))

With the patch:

diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
index c5d5671032..e010c2ef84 100644
--- a/Modules/_tracemalloc.c
+++ b/Modules/_tracemalloc.c
@@ -582,6 +582,8 @@ tracemalloc_add_trace(unsigned int domain, uintptr_t ptr,
 _Py_hashtable_entry_t* entry;
 int res;
 
+size += 4 * sizeof(size_t);
+
 assert(_Py_tracemalloc_config.tracing);
 
 traceback = traceback_new();

Replace 4 with 3 to measure memory used with the change.

--

Since Python 3.6, when the debug memory allocator detects a bug (ex: buffer 
overflow), it now also displays the Python traceback where the memory block has 
been allocated if tracemalloc is tracing Python memory allocations.

Example with buffer_overflow.py:
---
import _testcapi

def func():
_testcapi.pymem_buffer_overflow()

def main():
func()

if __name__ == "__main__":
main()
---

Output:
---
$ ./python -X tracemalloc=10 -X dev bug.py

Debug memory block at address p=0x7f45e85c3270: API 'm'
16 bytes originally requested
The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected.
The 8 pad bytes at tail=0x7f45e85c3280 are not all FORBIDDENBYTE (0xfd):
at tail+0: 0x78 *** OUCH
at tail+1: 0xfd
at tail+2: 0xfd
at tail+3: 0xfd
at tail+4: 0xfd
at tail+5: 0xfd
at tail+6: 0xfd
at tail+7: 0xfd
Data at p: cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd

Memory block allocated at (most recent call first):
  File "bug.py", line 4
  File "bug.py", line 7
  File "bug.py", line 10

Fatal Python error: bad trailing pad byte

Current thread 0x7f45f5660740 (most recent call first):
  File "bug.py", line 4 in func
  File "bug.py", line 7 in main
  File "bug.py", line 10 in 
Aborted (core dumped)
---

The interesting part is "Memory block allocated at (most recent call first):". 
Traceback reconstructed manually:
---
Memory block allocated at (most recent call first):
  File "bug.py", line 4
_testcapi.pymem_buffer_overflow()
  File "bug.py", line 7
func()
  File "bug.py", line 10
main()
---

You can see exactly where the memory block has been allocated.

Note: Internally, the _PyTraceMalloc_GetTraceback() function is used to get the 
traceback where a memory block has been allocated.

--

Extract of _PyMem_DebugRawAlloc() in Objects/obmalloc.c:

/* Let S = sizeof(size_t).  The debug malloc asks for 4*S extra bytes and
   fills them with useful stuff, here calling the underlying malloc's result p:

p[0: S]
Number of bytes originally asked for.  This is a size_t, big-endian (easier
to read in a memory dump).
p[S]
API ID.  See PEP 445.  This is a character, but seems undocumented.
p[S+1: 2*S]
Copies of FORBIDDENBYTE.  Used to catch under- writes and reads.
p[2*S: 2*S+n]
The requested memory, filled with copies of CLEANBYTE.
Used to catch reference to uninitialized memory.
&p[2*S] is returned.  Note that this is 8-byte aligned if pymalloc
handled the request itself.
p[2*S+n: 2*S+n+S]
Copies of FORBIDDENBYTE.  Used to catch over- writes and reads.
p[2*S+n+S: 2*S+n+2*S]
A serial number, incremented by 1 on each call to _PyMem_DebugMalloc
and _PyMem_DebugRealloc.
This is a big-endian size_t.
If "bad memo

[issue35520] Python won't build with dtrace enabled on some systems.

2019-04-12 Thread Jakub Kulik


Jakub Kulik  added the comment:

Can this also be backported to 3.7? I just installed 3.8a3 (where it already 
is) and it works as expected.

Also we are using this patch ourselves in 3.7 and it works but I guess it would 
be nicer to have it in upstream as well.

--

___
Python tracker 

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



[issue36600] re-enable test in nntplib

2019-04-12 Thread Martin Panter

Martin Panter  added the comment:

Does the test still depend on real-world posts? If so, see Issue 19613. I don’t 
think the problem has been fixed.

--
nosy: +martin.panter
superseder:  -> test_nntplib: sporadic failures, test_article_head_body()

___
Python tracker 

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



[issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint

2019-04-12 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint

2019-04-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12723

___
Python tracker 

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



[issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote 2 pull requests for the two options:

* PR 12795 removes serialno field
* PR 12796 adds PYMEM_DEBUG_SERIALNO define which is unset by default

--

___
Python tracker 

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



[issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint

2019-04-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12724

___
Python tracker 

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



[issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

While testing my changes, I found a bug in test_sys:

./python -X tracemalloc -m test test_sys -v -m test_getallocatedblocks

==
ERROR: test_getallocatedblocks (test.test_sys.SysModuleTest)
--
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/test/test_sys.py", line 770, in 
test_getallocatedblocks
alloc_name = _testcapi.pymem_getallocatorsname()
RuntimeError: cannot get allocators name

Attached PR 12797 fix it.

--

___
Python tracker 

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



[issue36579] test_venv: test_with_pip() hangs on PPC64 AIX 3.x

2019-04-12 Thread Michael Felt

Michael Felt  added the comment:

On 12/04/2019 10:28, Michael Felt wrote:
> Michael Felt  added the comment:
>
> On 10/04/2019 18:49, STINNER Victor wrote:
>> STINNER Victor  added the comment:
>>
>> "I am looking into this - but as it seems to have gone away again - is
>> there a simple way to get that code back, and/or see what the diff is,
>> before/badrun/after?"
>>
>> Maybe it's just a flacky test. It's hard to guess.
>>
>> You can get the Git revision of a build by looking at details:
>>
>> https://buildbot.python.org/all/#/builders/10/builds/2389
>> => Properties: "got_revision: 8702b67dad62a9084f6c1823dce10653743667c8"
>>
>> See also "Changes" tab.
>>
>> Sometimes when a bug disappears, I just close it as "outdated" after a few 
>> weeks.
>>
>> --
>>
>> ___
>> Python tracker 
>> 
>> ___
>>
> I'll try a manual build on the gccfarm. Not exactly the same
> environment, but as close as I can get.
>
> --

The single test passes:

$ ./python -m test -v test_venv
== CPython 3.8.0a3+ (v3.8.0a3-109-g8702b67:8702b67, Apr 12 2019,
04:35:08) [GCC 7.2.0]
== AIX-2-00FA74164C00-powerpc-32bit big-endian
== cwd: /home/aixtools/python/test_venv/build/test_python_27132304
== CPU count: 64
== encodings: locale=ISO8859-1, FS=iso8859-1
Run tests sequentially
0:00:00 [1/1] test_venv
test_defaults (test.test_venv.BasicTest) ... ok
test_executable (test.test_venv.BasicTest) ... ok
test_executable_symlinks (test.test_venv.BasicTest) ... ok
test_isolation (test.test_venv.BasicTest) ... ok
test_multiprocessing (test.test_venv.BasicTest) ... ok
test_overwrite_existing (test.test_venv.BasicTest) ... ok
test_prefixes (test.test_venv.BasicTest) ... ok
test_prompt (test.test_venv.BasicTest) ... ok
test_symlinking (test.test_venv.BasicTest) ... ok
test_unicode_in_batch_file (test.test_venv.BasicTest) ... skipped 'only
relevant on Windows'
test_unoverwritable_fails (test.test_venv.BasicTest) ... ok
test_upgrade (test.test_venv.BasicTest) ... ok
test_devnull (test.test_venv.EnsurePipTest) ... ok
test_explicit_no_pip (test.test_venv.EnsurePipTest) ... ok
test_no_pip_by_default (test.test_venv.EnsurePipTest) ... ok
test_with_pip (test.test_venv.EnsurePipTest) ... ok

--

Ran 16 tests in 172.244s

OK (skipped=1)
test_venv passed in 2 min 52 sec

== Tests result: SUCCESS ==

With "make test" - they also all pass (make buildbottest did not run as
expected, only one thread, make test runs with CPU: 64)

...

0:05:50 [420/420/1] test_venv passed (5 min 43 sec)

== Tests result: SUCCESS ==

401 tests OK.

1 test altered the execution environment:
    test_concurrent_futures

18 tests skipped:
    test_curses test_devpoll test_epoll test_gdb test_kqueue
    test_msilib test_ossaudiodev test_spwd test_startfile test_tix
    test_tk test_ttk_guionly test_unicode_file
    test_unicode_file_functions test_winconsoleio test_winreg
    test_winsound test_zipfile64

Total duration: 5 min 50 sec
Tests result: SUCCESS

So, I guess "flacky". Cannot reproduce in any case.

>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint

2019-04-12 Thread Inada Naoki


Inada Naoki  added the comment:

I never used the serialno too.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is related to the following thread on python-dev which discuss 
disabling Py_TRACE_REFS by default, bpo-36465, to reduce the memory footprint 
in debug mode:
https://mail.python.org/pipermail/python-dev/2019-April/157015.html

--

___
Python tracker 

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



[issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

The serialno has been added at the same time than the whole debug hooks on 
Python memory allocated by Tim Peters in 2002, 17 years ago:

commit ddea208be9e2a8fa281e25ebbc890378dd2aa286
Author: Tim Peters 
Date:   Sat Mar 23 10:03:50 2002 +

Give Python a debug-mode pymalloc, much as sketched on Python-Dev.

When WITH_PYMALLOC is defined, define PYMALLOC_DEBUG to enable the debug
allocator.  This can be done independent of build type (release or debug).
A debug build automatically defines PYMALLOC_DEBUG when pymalloc is
enabled.  It's a detected error to define PYMALLOC_DEBUG when pymalloc
isn't enabled.

Two debugging entry points defined only under PYMALLOC_DEBUG:

+ _PyMalloc_DebugCheckAddress(const void *p) can be used (e.g., from gdb)
  to sanity-check a memory block obtained from pymalloc.  It sprays
  info to stderr (see next) and dies via Py_FatalError if the block is
  detectably damaged.

+ _PyMalloc_DebugDumpAddress(const void *p) can be used to spray info
  about a debug memory block to stderr.

A tiny start at implementing "API family" checks isn't good for
anything yet.

_PyMalloc_DebugRealloc() has been optimized to do little when the new
size is <= old size.  However, if the new size is larger, it really
can't call the underlying realloc() routine without either violating its
contract, or knowing something non-trivial about how the underlying
realloc() works.  A memcpy is always done in this case.

This was a disaster for (and only) one of the std tests:  test_bufio
creates single text file lines up to a million characters long.  On
Windows, fileobject.c's get_line() uses the horridly funky
getline_via_fgets(), which keeps growing and growing a string object
hoping to find a newline.  It grew the string object 1000 bytes each
time, so for a million-character string it took approximately forever
(I gave up after a few minutes).

So, also:

fileobject.c, getline_via_fgets():  When a single line is outrageously
long, grow the string object at a mildly exponential rate, instead of
just 1000 bytes at a time.

That's enough so that a debug-build test_bufio finishes in about 5 seconds
on my Win98SE box.  I'm curious to try this on Win2K, because it has very
different memory behavior than Win9X, and test_bufio always took a factor
of 10 longer to complete on Win2K.  It *could* be that the endless
reallocs were simply killing it on Win2K even in the release build.

--
nosy: +tim.peters

___
Python tracker 

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



[issue34144] venv activate.bat reset codepage fails on windows 10

2019-04-12 Thread Cheryl Sabella


Change by Cheryl Sabella :


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



[issue36612] Unittest document is not clear on SetUpClass calls

2019-04-12 Thread Vratko Polak


New submission from Vratko Polak :

One particular paragraph from unittest.rst is not clear enough:

"If you want the setUpClass and tearDownClass on base classes called then you 
must call up to them yourself. The implementations in TestCase are empty."

It has sparkled a debate here [0].

Example:
A class SuperTestCase, which inherits from unittest.TestCase, defines some 
non-trivial setUpClass class method. Then a class SubTestCase, which inherits 
from SuperTestCase, wants to have SuperTestCase.setUpClass executed as its 
setUpClass.
Does SubTestCase need to override setUpClass just to call 
SuperTestCase.setUpClass (as the paragraphs might suggest), or can it rely in 
inheritance to have it executed without overriding?

I will create GitHub PR soon.

[0] https://gerrit.fd.io/r/#/c/18579/1/test/test_sparse_vec.py@14

--
assignee: docs@python
components: Documentation
messages: 340028
nosy: docs@python, vrpolakatcisco
priority: normal
severity: normal
status: open
title: Unittest document is not clear on SetUpClass calls
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



[issue36579] test_venv: test_with_pip() hangs on PPC64 AIX 3.x

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

Since build 2389 which failed, 21 builds succeeded. The failure looks random, 
so I success to close the issue. I leave it open since it seems like Michael 
Felt is interested to investigate ;-)

--

___
Python tracker 

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



[issue21110] Slowdown and high memory usage when adding a new module in embedded Python 3.4 on 64bit Windows

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

Steve: Are you aware of this issue? "Apparently, you need to add this to your C 
program: #define HAVE_SSIZE_T"

--
nosy: +steve.dower

___
Python tracker 

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



[issue36579] test_venv: test_with_pip() hangs on PPC64 AIX 3.x

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, I missed your second message: "So, I guess "flacky". Cannot reproduce in 
any case."

So well, I close the issue. It's ok, sometimes things break randomly :-) The 
important thing is that the current status is that tests pass ;-)

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



[issue36612] Unittest document is not clear on SetUpClass calls

2019-04-12 Thread Vratko Polak


Change by Vratko Polak :


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

___
Python tracker 

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



[issue36537] except statement block incorrectly assumes end of scope(?).

2019-04-12 Thread Saim Raza


Saim Raza  added the comment:

This is pretty unintuitive from a user's stand point. Now, I need to 
*inconveniently* put some dummy code after the ser_trace call every time I want 
to access the exception inside the except block.

Also, this is a change in behavior from Python 2.7. Is this documented 
somewhere?

--

___
Python tracker 

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



[issue36612] Unittest document is not clear on SetUpClass calls

2019-04-12 Thread SilentGhost


SilentGhost  added the comment:

Normal inheritance rules apply to TestCase and its subclasses, as can be 
demonstrated by a trivial example.

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



[issue36613] asyncio._wait() don't remove callback in case of exception

2019-04-12 Thread Aleksandr Balezin


New submission from Aleksandr Balezin :

Attached script shows unexpected behavior of the wait() function.
The wait_ function adds done callback on every call and removes it only if a 
waiter is successfully awaited. In case of CancelledError exception during 
"await waiter", callbacks are being accumulated infinitely in task._callbacks.

--
components: asyncio
files: asyncio_wait_callbacks_leak.py
messages: 340034
nosy: asvetlov, gescheit, yselivanov
priority: normal
severity: normal
status: open
title: asyncio._wait() don't remove callback in case of exception
type: resource usage
versions: Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file48263/asyncio_wait_callbacks_leak.py

___
Python tracker 

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



[issue36537] except statement block incorrectly assumes end of scope(?).

2019-04-12 Thread SilentGhost


SilentGhost  added the comment:

Saim, a .post_mortem could be used instead. As I noted, it works just fine.

--

___
Python tracker 

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



[issue34652] never enable lchmod on Linux

2019-04-12 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +12727

___
Python tracker 

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



[issue36613] asyncio._wait() don't remove callback in case of exception

2019-04-12 Thread Aleksandr Balezin


Change by Aleksandr Balezin :


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

___
Python tracker 

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



[issue36537] except statement block incorrectly assumes end of scope(?).

2019-04-12 Thread Saim Raza


Saim Raza  added the comment:

Thanks, SilentGhost! However, should we try to fix set_trace as well to avoid 
hassles to other users?

--

___
Python tracker 

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



[issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9b8314cfe29ca532fc335277f6c36b72e6132922 by Victor Stinner in 
branch 'master':
bpo-36611: Fix test_sys.test_getallocatedblocks() (GH-12797)
https://github.com/python/cpython/commit/9b8314cfe29ca532fc335277f6c36b72e6132922


--

___
Python tracker 

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



[issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint

2019-04-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12729

___
Python tracker 

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



[issue32451] python -m venv activation issue when using cygwin on windows

2019-04-12 Thread Eryk Sun


Eryk Sun  added the comment:

Why is the bash/zsh "activate" script getting distributed with CRLF line 
endings? Apparently Windows builds of bash (e.g. git-bash) can handle CRLF line 
endings, but Cygwin bash cannot.

As to Linux bash in WSL, the activate script from a virtual environment created 
by Windows Python can't be used anyway. It modifies $PATH using a DOS path like 
"C:\taco" as opposed to a WSL path like "/mnt/c/taco".

> when running "pip freeze" in number 3 it returns the system 
> packages despite the "include-system-site-packages = False" 
> in pyvenv.cfg 

The 3rd attempt is just running activate.bat from a CMD shell. That should 
work, unless you `exit` out of CMD back to bash. Anyway, check `where.exe pip` 
after activating. It should find "C:\taco\Scripts\pip.exe" first.

--
components: +Windows
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware
versions: +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



[issue36608] Replace bundled pip and setuptools with a downloader in the ensurepip module

2019-04-12 Thread Eric V. Smith


Eric V. Smith  added the comment:

ensurepip does not access the network, by design. We do not want it to start 
access the network without a lot of discussion.

And if it does access the network, it will need to be able to use alternate 
URLs. For example: where I deploy Python, it would not have access to the URLs 
in your PR, but instead would need to specify a different (internal) location. 
This is the same reason that pip install has --find-links, --no-index, 
--extra-index-url, etc.

I think this would need a lot of discussion (probably on distutils-sig), and 
probably a PEP.

--
nosy: +eric.smith

___
Python tracker 

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



[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2019-04-12 Thread Anders Hovmöller

Anders Hovmöller  added the comment:

That might be true, but that seems like a weak argument. If anything, it means 
those others are broken. What is the logic behind "(.*)" returning the entire 
string (which is what you asked for) and exactly one empty string? Why not two 
empty strings? 3? 4? 5? Why not an empty string at the beginning? It makes no 
practical sense.

We will have to spend considerable effort to work around this change and adapt 
our code to 3.7. The lack of a discussion about backwards compatibility in 
this, and the other, thread before making this change is also a problem I think.

--

___
Python tracker 

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



[issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint

2019-04-12 Thread miss-islington


miss-islington  added the comment:


New changeset 7182e653fb5c6f78f05892b6ed302fc8db8978d3 by Miss Islington (bot) 
in branch '3.7':
bpo-36611: Fix test_sys.test_getallocatedblocks() (GH-12797)
https://github.com/python/cpython/commit/7182e653fb5c6f78f05892b6ed302fc8db8978d3


--
nosy: +miss-islington

___
Python tracker 

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



[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-12 Thread Paul Ganssle


Paul Ganssle  added the comment:

> rglob and glob also return a generator.

My mistake, I didn't notice the `sorted` in the `rglob` documentation and 
thought it was emitting a list.

> By that logic, we should remove `Path.iterdir()` in favour of 
> `Path.glob('*')`.

What *is* the case for why iterdir() is justified when `Path.glob('*')` exists? 
Is it just discoverability? Is there some efficiency reason to do it?

Of course, removing things (which can break existing code) and failing to add 
them (which cannot) have two different thresholds for when they can take place, 
so even if we decide "iterdir() is to glob('*') as iterdir(recursive=True) is 
to rglob('*')", that doesn't mean that we should remove iterdir() entirely if 
recursive=True is not added.

> I agree, which is the main reason the current implementation in the 
> pull-request is to not resolve symlinks: users can subclass and implement 
> symlink resolving if they want

I don't see that on the implementation here, but we can discuss this on the PR 
itself. I do think that skipping *all* symlinks automatically with no option to 
follow them will be counter-intuitive for people.

> I've never really liked the interface to `walk`, personal preference

I kinda agree about the interface to `walk`, but it is worth noting that as 
we've seen in this thread, there are a bunch of plausible and slightly 
different ways to walk a directory: breadth-first or depth-first? following 
symlinks, following symlinks with cycle detection, or not following symlinks at 
all? emit the directory itself, or only emit its contents? It's worth taking 
into account that having two completely different complicated interfaces for 
recursively walking directories would be a usability challenge.

--

___
Python tracker 

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



[issue36537] except statement block incorrectly assumes end of scope(?).

2019-04-12 Thread SilentGhost


SilentGhost  added the comment:

I cannot imagine that the fix would be straightforward or that there is much 
use of this particular pattern. Perhaps, a note in the docs suggesting 
post_mortem() for except clauses over set_trace() would be more appropriate.

--

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-04-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12730

___
Python tracker 

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



[issue36614] Popen

2019-04-12 Thread weispinc


New submission from weispinc :

Popen, when run on Windows server 2019 does not output binary by default.
Tried Python 3.5 3.6 3.7.
OK on Windows server 2016 and 1012.

--
messages: 340044
nosy: weispinc
priority: normal
severity: normal
status: open
title: Popen
type: behavior

___
Python tracker 

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



[issue36614] Popen output on windows server 2019

2019-04-12 Thread SilentGhost


SilentGhost  added the comment:

Could you add the code that you're running.

--
components: +Library (Lib), Windows
nosy: +SilentGhost, paul.moore, steve.dower, tim.golden, zach.ware
title: Popen -> Popen output on windows server 2019
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



[issue17267] datetime.time support for '+' and '-'

2019-04-12 Thread Paul Ganssle


Paul Ganssle  added the comment:

I am pretty neutral on this. I don't think it will be terribly difficult to 
implement or maintain this, and while there are a few possible behaviors, if 
you think about it for a bit, addition with overflow behavior *does* seem like 
the natural way to implement it.

That said, I don't see an amazingly compelling use case for this. It's fairly 
rare to need to represent abstract times *at all*, and it's even more rare for 
performing arithmetic on those abstract times to be meaningful. I think the 
most dangerous aspect of this is that we might make it easier to do something 
that, for most people, would be the wrong thing to do.

Does anyone have some examples of real-world use cases for this, so that we're 
not designing in a vacuum?

--

___
Python tracker 

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



[issue36549] str.capitalize should titlecase the first character not uppercase

2019-04-12 Thread Kingsley McDonald


Change by Kingsley McDonald :


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



[issue36614] Popen output on windows server 2019

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

> Popen, when run on Windows server 2019 does not output binary by default.

What do you mean by "binary"?

--
nosy: +vstinner

___
Python tracker 

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



[issue36588] change sys.platform() to just "aix" for AIX

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9d949f7796da612f1b588d18c6f041376992a9fc by Victor Stinner 
(Michael Felt) in branch 'master':
bpo-36588: On AIX, remove major version from sys.platform (GH-12787)
https://github.com/python/cpython/commit/9d949f7796da612f1b588d18c6f041376992a9fc


--

___
Python tracker 

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



[issue36588] change sys.platform() to just "aix" for AIX

2019-04-12 Thread STINNER Victor


Change by STINNER Victor :


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



[issue36588] change sys.platform() to just "aix" for AIX

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

Do you want to work on a change to replace sys.platform.startswith("aix") to 
cleanup the stdlib and tests? Not sure if it's needed :-) It's up to you.

--

___
Python tracker 

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



[issue36614] Popen output on windows server 2019

2019-04-12 Thread weispinc


Change by weispinc :


Added file: https://bugs.python.org/file48264/popen.py

___
Python tracker 

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



[issue36615] why call _Py_set_inheritable(0) from os.open() when O_CLOEXEC?

2019-04-12 Thread cagney


New submission from cagney :

When O_CLOEXEC is defined the file is opened with that flag (YA! - this means 
that the operation is atomic and, by default, the FD will be closed across 
os.posix_spawn()).

However the code then goes on an executes:

#ifndef MS_WINDOWS
if (_Py_set_inheritable(fd, 0, atomic_flag_works) < 0) {
close(fd);
return -1;
}
#endif

should this also be #ifndef O_CLOEXEC?

--
messages: 340050
nosy: cagney
priority: normal
severity: normal
status: open
title: why call _Py_set_inheritable(0) from os.open() when O_CLOEXEC?
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



[issue36615] why call _Py_set_inheritable(0) from os.open() when O_CLOEXEC?

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

The Linux kernel has a bad habit of ignoring unknown flags. If your libc is 
recent and contains O_CLOEXEC but your Linux kernel is old and doesn't know 
O_CLOEXEC, the flag will be simply ignored. It can happen when a Linux 
distribution builds a package with a recent kernel / libc, but you run an older 
kernel / libc. More info in the PEP 446:

https://www.python.org/dev/peps/pep-0446/#atomic-creation-of-non-inheritable-file-descriptors

> if (_Py_set_inheritable(fd, 0, atomic_flag_works) < 0) {

Look for the atomic_flag_works: if it's 1, the function does nothing.

I don't think that this issue is a bug, so I suggest to close it. The bug 
tracker is not the right place to ask questions ;-)

--
nosy: +vstinner

___
Python tracker 

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



[issue32451] python -m venv activation issue when using cygwin on windows

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:

It probably just needs a gitattributes fix so it doesn't get converted when 
cloned to make the release build.

This is assuming that in all these cases people are installing Python for 
Windows and trying to use it from a non-Windows shell (both WSL and Cygwin have 
their own "native" Python builds that presumably work). I can't tell if there's 
something else going on here.

--

___
Python tracker 

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



[issue36614] Popen output on windows server 2019

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:

As we haven't done anything special for WS2019 yet, this is a change in Windows 
(or whatever tool is outputting the text).

You could report it to Microsoft. I don't know the best way to report bugs in 
Windows Server though, but most people with it have support contacts.

--

___
Python tracker 

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



[issue36591] Should be a typing.UserNamedTuple

2019-04-12 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

This is a duplicate of https://github.com/python/typing/issues/431

We can of course close the other issue and keep this one open, but the other 
one has much more discussion. So I am closing this one.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue18748] io.IOBase destructor silence I/O error on close() by default

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 44235041f3b957abd36d3792450c3540aa09e120 by Victor Stinner in 
branch 'master':
bpo-18748: io.IOBase destructor now logs close() errors in dev mode (GH-12786)
https://github.com/python/cpython/commit/44235041f3b957abd36d3792450c3540aa09e120


--

___
Python tracker 

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



[issue18748] io.IOBase destructor silence I/O error on close() by default

2019-04-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12732

___
Python tracker 

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



[issue18748] io.IOBase destructor silence I/O error on close() by default

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

To debug remaining "Exception ignored in:" issues, I'm using the following 
patch:

diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py
index 972a4658b1..be38af3daa 100644
--- a/Lib/unittest/case.py
+++ b/Lib/unittest/case.py
@@ -710,6 +710,7 @@ class TestCase(object):
 
 # clear the outcome, no more needed
 self._outcome = None
+import gc; gc.collect()
 
 def doCleanups(self):
 """Execute all cleanup functions. Normally called for you after

And I run:

./python -X dev -u -m test test_io -v 2>&1|tee log

--

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread Eric Snow


Eric Snow  added the comment:


New changeset f13c5c8b9401a9dc19e95d8b420ee100ac022208 by Eric Snow in branch 
'master':
bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). 
(gh-12360)
https://github.com/python/cpython/commit/f13c5c8b9401a9dc19e95d8b420ee100ac022208


--

___
Python tracker 

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



[issue18748] io.IOBase destructor silence I/O error on close() by default

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

Is there someone interested to debug remaining "Exception ignored:" logs in 
test_urllib?

test_invalid_redirect (test.test_urllib.urlopen_HttpTests) ...
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
ok

test_read_bogus (test.test_urllib.urlopen_HttpTests) ...
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
ok

test_redirect_limit_independent (test.test_urllib.urlopen_HttpTests) ...
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
ok


It's unclear to be if it's a bug in http.client, a bug in the test... or 
something else.

--

___
Python tracker 

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



[issue18748] io.IOBase destructor silence I/O error on close() by default

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 12805 to silence IOBase destructor exceptions in test_io.

--

___
Python tracker 

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



[issue36608] Replace bundled pip and setuptools with a downloader in the ensurepip module

2019-04-12 Thread Eric V. Smith


Eric V. Smith  added the comment:

And I don't mean to sound like a total downer. I just think it's important that 
we recognize all of the use cases.

Thanks for your work on this.

--

___
Python tracker 

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



[issue36588] change sys.platform() to just "aix" for AIX

2019-04-12 Thread Michael Felt


Michael Felt  added the comment:

On 12/04/2019 16:16, STINNER Victor wrote:
> STINNER Victor  added the comment:
>
> Do you want to work on a change to replace sys.platform.startswith("aix") to 
> cleanup the stdlib and tests? Not sure if it's needed :-) It's up to you.
>
> --
>
> ___
> Python tracker 
> 
> ___
>
Sure. I'll do that. I shoul open an issue along the lines of "AIX:
cleanup stdlib and tests and how sys.platform is utilized".

But, should I just continue standard practice (sys.platform), or would
this be a moment to move towards platform.system() (i.e., set the
example to be to use "run-time" rather than "build-time").

Michael

--

___
Python tracker 

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



[issue18748] io.IOBase destructor silence I/O error on close() by default

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

Maybe the fact that close() exceptions are ignored silently in io.IOBase 
constructor should be better documented, but I'm not sure where it should be 
documented. If someone has an idea, please go ahead and write a pull request :-)

--

___
Python tracker 

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



[issue36610] os.sendfile can return EINVAL on Solaris

2019-04-12 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

Can you paste the traceback or are you able to reproduce the bug via a script? 
sendfile implementation is supposed to giveup if no data was sent on first 
call, so I suppose this happen later? If for any reason it turns out sendfile() 
is broken on Solaris or behave differently than on Linux I think I prefer to be 
safe than sorry and support it on Linux only.

--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue36588] change sys.platform() to just "aix" for AIX

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

> But, should I just continue standard practice (sys.platform), or would
> this be a moment to move towards platform.system() (i.e., set the
> example to be to use "run-time" rather than "build-time").

Oh, now I'm confused :-) I checked the Python test suite: some tests use 
sys.platform == "linux" or sys.platform in ("linux", ...), some tests uses 
sys.platform.startswith("linux").

In case of doubt, I suggest to do nothing :-) Leave the code unchanged :-)

--

___
Python tracker 

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



[issue32451] python -m venv activation issue when using cygwin on windows

2019-04-12 Thread Eryk Sun


Eryk Sun  added the comment:

> This is assuming that in all these cases people are installing Python 
> for Windows and trying to use it from a non-Windows shell (both WSL 
> and Cygwin have their own "native" Python builds that presumably 
> work).

It should work from Cygwin and MSYS2 since they support DOS paths in $PATH. I 
don't have Cygwin installed, but I tried MSYS2 bash and Git bash, and it worked 
fine, even with CRLF line endings. Apparently only Cygwin bash has a problem 
with CRLF line endings. 

The issue with using Windows Python in this case is that the terminals for 
these environments emulate Unix PTYs with named pipes (e.g. 
"msys-0123456789abcdef-pty0-from-master" for stdin and 
"msys-0123456789abcdef-pty0-to-master" for stdout and stderr). Thus isatty() is 
false, and interactive mode has to be forced with the `-i` command-line option.

--

___
Python tracker 

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



[issue36549] str.capitalize should titlecase the first character not uppercase

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:


New changeset b015fc86f7b1f35283804bfee788cce0a5495df7 by Steve Dower (Kingsley 
M) in branch 'master':
bpo-36549: str.capitalize now titlecases the first character instead of 
uppercasing it (GH-12804)
https://github.com/python/cpython/commit/b015fc86f7b1f35283804bfee788cce0a5495df7


--
nosy: +steve.dower

___
Python tracker 

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



[issue36549] str.capitalize should titlecase the first character not uppercase

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:

Thanks! I'm a big fan of this change :)

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



[issue36614] Popen output on windows server 2019

2019-04-12 Thread weispinc


weispinc  added the comment:

The tool is outputing exactly the same file on both WS2019 and WS2016.
I guess Popen is using some OS library or environment that has changed in 
WS2019.

--

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

I have a bad news for you Eric: I'm able again to reproduce the crash at commit 
f13c5c8b9401a9dc19e95d8b420ee100ac022208.


vstinner@freebsd$ ./python -m test --matchfile=bisect5 
test_multiprocessing_spawn --fail-env-changed -F
Run tests sequentially
0:00:00 load avg: 0.69 [  1] test_multiprocessing_spawn
0:00:06 load avg: 0.80 [  2] test_multiprocessing_spawn
0:00:12 load avg: 1.19 [  3] test_multiprocessing_spawn
...
0:01:55 load avg: 1.48 [ 21] test_multiprocessing_spawn
0:02:01 load avg: 1.53 [ 22] test_multiprocessing_spawn
0:02:08 load avg: 1.29 [ 23] test_multiprocessing_spawn
0:02:17 load avg: 1.51 [ 24] test_multiprocessing_spawn
0:02:27 load avg: 2.27 [ 25] test_multiprocessing_spawn
0:02:38 load avg: 3.14 [ 26] test_multiprocessing_spawn
0:02:48 load avg: 3.51 [ 27] test_multiprocessing_spawn
Warning -- files was modified by test_multiprocessing_spawn
  Before: []
  After:  ['python.core'] 
test_multiprocessing_spawn failed (env changed)

== Tests result: ENV CHANGED ==

All 26 tests OK.

1 test altered the execution environment:
test_multiprocessing_spawn

Total duration: 2 min 59 sec
Tests result: ENV CHANGED


Note: Sorry for not testing before, after one long week, I didn't succeed to 
catch up with my very long list of unread emails.

I don't know what should be done. Revert? I don't have the bandwidth to 
investigate this crash.

--

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

I ran "./python -m test --matchfile=bisect5 test_multiprocessing_spawn 
--fail-env-changed -F" 4 times in parallel: in less than 5 minutes (in fact, I 
didn't look carefully at the terminal, maybe it was faster), I got 3 core dumps 
:-(

--

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread Eric Snow


Eric Snow  added the comment:

Thanks for checking, Victor.  Don't feel bad about your results, nor about not 
checking sooner. :)  We'll get this sorted out.

For now I'll revert.  This is not code that changes very often, so there isn't 
much benefit to keeping it merged.  Testing against a separate branch is just 
as easy.

Could you point me at an immage for that VM or instructions on how to reproduce 
it?  I hate having to bother you to test my changes! :)

--

___
Python tracker 

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



[issue34652] never enable lchmod on Linux

2019-04-12 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 0fd5a7338cbaf7a61ab5bad270c1b0311047d0f9 by Benjamin Peterson 
(Joshua Root) in branch '2.7':
bpo-34652: Use AC_CHECK_FUNCS for lchmod. (GH-12799)
https://github.com/python/cpython/commit/0fd5a7338cbaf7a61ab5bad270c1b0311047d0f9


--

___
Python tracker 

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



[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:

Having spent more time than I'm proud of recursing through directories, I'd be 
happy enough with a convenience function that has sensible defaults.

If I want breadth-first recursion (and I often do), I'll write it myself. I 
have a slight preference for getting all files in a directory before going 
deeper (which is not what the PR does), and I think that's most consistent with 
the current behaviour.

I don't spend enough time dealing with symlinks to have strong opinions there, 
but given we have ways to resolve symlinks but not to get back to the original 
name (and I *have* had to deal with issues where I've needed to find the 
original name from the target :roll-eyes:) I'd say don't resolve anything 
eagerly.

If there's an easy and well-known algorithm for detecting infinite symlink 
recursion (e.g. resolve and check if it's a parent of itself) then do that and 
skip it, but don't return the targets.

--
nosy: +steve.dower

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +12733

___
Python tracker 

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



[issue36601] signals can be caught by any thread

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:

Looks like Guido added the original code about 25 years ago. Since he removed 
himself from the other thread during that discussion, I'm going to assume he's 
not interested in thinking about it any more.

As the original comment says, it's a hack, but I guess there may have been an 
OS around at the time that would deliver signals across processes? Maybe after 
fork? It might be worth pinging python-dev briefly just to check if anyone 
there knows of an OS that might do this.

That said, the comment change in the PR looks totally fine to me. I'm just 
hesitant to remove something that's apparently been working for a quarter of a 
century ;)

--
nosy: +steve.dower

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

Eric Snow:
> For now I'll revert.  This is not code that changes very often, so there 
> isn't much benefit to keeping it merged.  Testing against a separate branch 
> is just as easy.

Again, Python shutdown is *really* fragile. Last time I tried to "enhance" it, 
I also introduced random regressions and so I had to revert my changes.

Old info about the crash, should still be relevant:
https://bugs.python.org/issue36114#msg337090

> Could you point me at an immage for that VM or instructions on how to 
> reproduce it?  I hate having to bother you to test my changes! :)

*In theory*, you should be able to reproduce the crash on any platform. But in 
my experience, bugs which involve multiple threads are simply "more likely" on 
FreeBSD because FreeBSD manages threads very differently than Linux. Sometimes, 
a bug can only be reproduce on one specific FreeBSD computer, but once the root 
issue has been identified, we start to be able to trigger the crash reliably on 
other platforms (like Linux).

My procedure to reproduce the crash on FreeBSD:
https://bugs.python.org/issue36114#msg337092

I'm using FreeBSD 12.0 RELEASE VM hosted on Linux. My FreeBSD is not customized 
in any way.

On modern Linux distributions, coredumps are no longer written in the current 
directory but handled by a system service like ABRT on Fedora. For this reason, 
Python test runner can "miss" crashes, especially in child processes run by 
tests (not directly in the process used to run the test).

To get a coredump in the current directory on Linux, you can use:

sudo bash -c 'echo "%e.%p" > /proc/sys/kernel/core_pattern'

Manual test:

$ ./python -c 'import ctypes; ctypes.string_at(0)'
Segmentation fault (core dumped)

vstinner@apu$ git status
...
Untracked files:
python.18343
...

Say hello to python.18343 coredump!


Usually, running the command which trigger the crash multiple times in parallel 
(in different terminals, using screen and multiple terminals, etc.) makes the 
crash more likely since it does stress the system.

Sometimes, I run the Python test suite in parallel to stress the system even 
more.

The goal of the game is to trigger a race condition which depends on time. 
Stressing the system helps to "randomize" timings.

--

___
Python tracker 

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



[issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads

2019-04-12 Thread Sam Dunster


Change by Sam Dunster :


--
nosy: +sdunster

___
Python tracker 

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



[issue36488] os.sendfile() on BSD, macOS don't return bytes sent on EINTR

2019-04-12 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


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



[issue36549] str.capitalize should titlecase the first character not uppercase

2019-04-12 Thread Zackery Spytz


Zackery Spytz  added the comment:

I think that the PR may have been merged too quickly. Serhiy had made a list, 
and I think that the PR was missing some necessary changes.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread Eric Snow


Eric Snow  added the comment:


New changeset b75b1a3504a0cea6fac6ecba44c10b2629577025 by Eric Snow in branch 
'master':
bpo-33608: Revert "Factor out a private, per-interpreter _Py_AddPendingCall()." 
(gh-12806)
https://github.com/python/cpython/commit/b75b1a3504a0cea6fac6ecba44c10b2629577025


--

___
Python tracker 

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



[issue36601] signals can be caught by any thread

2019-04-12 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue36616] Optimize thread state handling in function call code

2019-04-12 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


--
type:  -> performance

___
Python tracker 

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



[issue36616] Optimize thread state handling in function call code

2019-04-12 Thread Jeroen Demeyer


New submission from Jeroen Demeyer :

The bytecode interpreter uses an inline function call_function() to handle most 
function calls. To check for profiling, call_function() needs to call to 
PyThreadState_GET().

In the reference implementation of PEP 590, I saw that we can remove these 
PyThreadState_GET() calls by passing the thread state from the main eval loop 
to call_function().

I suggest to apply this optimization now, because they make sense independently 
of PEP 580 and PEP 590 and to give a better baseline for performance 
comparisons.

--
components: Interpreter Core
messages: 340078
nosy: Mark.Shannon, jdemeyer, petr.viktorin
priority: normal
severity: normal
status: open
title: Optimize thread state handling in function call code
versions: 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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

I tried but failed to reproduce the crash on Linux!?

$ sudo bash -c 'echo "%e.%p" > /proc/sys/kernel/core_pattern'
$ ./python -m test --matchfile=bisect5 test_multiprocessing_spawn 
--fail-env-changed -F
# wait 5 min
^C
$ ./python -m test --matchfile=bisect5 -j0 test_multiprocessing_spawn 
--fail-env-changed -F  # I added -j0
# wait 5 min
^C
$ ./python -m test --matchfile=bisect5 -j0 test_multiprocessing_spawn 
--fail-env-changed -F  # I added -j0
# wait 5 min
^C

No coredump seen...

--

___
Python tracker 

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



[issue36552] Replace OverflowError with ValueError when calculating length of range objects > PY_SIZE_MAX

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:

We should at least have consistent error messages:

>>> class O:
...  def __len__(self):
...   return 2**100
...
>>> o=O()
>>> len(o)
Traceback (most recent call last):
  File "", line 1, in 
OverflowError: cannot fit 'int' into an index-sized integer

I'd argue for replacing 'int' here with the rendered value, but I think 
OverflowError is the right type. Mentioning "C ssize_t" is the problem.

As for the list constructor, I'd be okay with chaining a MemoryError here, 
provided the OverflowError sticks around. But in this context a MemoryError is 
"recoverable" while an OverflowError very likely indicates a programming error, 
so we shouldn't hide it from the user.

--
nosy: +steve.dower

___
Python tracker 

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



[issue36601] signals can be caught by any thread

2019-04-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

IIRC in SGI, getpid() would return the thread ID. They had a syscall that could 
create a new subprocess that would share or not share various resources (e.g. 
memory, signals, file descriptors) so by setting or clearing bits you could 
implement a continuum of variations between fork and thread creation (for 
thread creation you'd share everything). Maybe a similar thing exists in Linux? 
But IRIX is dead so I think it's safe to kill.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue36513] Add support for building arm32 nuget package

2019-04-12 Thread Steve Dower


Change by Steve Dower :


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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-04-12 Thread STINNER Victor


STINNER Victor  added the comment:

FYI AMD64 FreeBSD CURRENT Shared 3.x failed at commit 
f13c5c8b9401a9dc19e95d8b420ee100ac022208:
https://buildbot.python.org/all/#/builders/168/builds/913

But this issue has already been fixed: Eric reverted his change.

--

___
Python tracker 

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



[issue36509] Add iot layout for windows iot containers

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:


New changeset f4e5661e85ac41c987165246d2b33f363cd01e34 by Steve Dower (Paul 
Monson) in branch 'master':
bpo-36509: Add iot layout for Windows IoT containers (GH-12663)
https://github.com/python/cpython/commit/f4e5661e85ac41c987165246d2b33f363cd01e34


--

___
Python tracker 

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



[issue36617] The rich comparison operators are second class citizens

2019-04-12 Thread Dan Snider


New submission from Dan Snider :

The rich comparison operators have an (far as I can tell, unnecessary) 
limitation compared to the other binary operators, being that the result of an 
unparenthesized comparison expression cannot be unpacked using the *iterable 
"unpack" operator (does that thing have an official name?)

Here's a silly demonstration of what I'm talking about:
 
 >>> if 1:
... parser.expr("[*+-~d<
Traceback (most recent call last):
  File "", line 3, in 
  File "", line 1
[*+-~d<=b-~+_]
   ^
SyntaxError: invalid syntax


>>> if 1:
... parser.expr("f(*+d<<-b)")
... parser.expr("f(*+d<=-b)")
...




Because the limitation is not present for function calls, I suspect this is 
simply a "typo" that's gone unnoticed for years, due to nobody ever trying it. 
I'm hardly an expert on the parser and can barely read the grammar file so i 
might be totally wrong here. But then, what would be the difference between the 
expressions: [*a+b+c+d, *e-f] and [*a>> class S(list): __lt__ = list.__add__

--
messages: 340084
nosy: bup
priority: normal
severity: normal
status: open
title: The rich comparison operators are second class citizens

___
Python tracker 

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



[issue36601] signals can be caught by any thread

2019-04-12 Thread Eryk Sun


Eryk Sun  added the comment:

> Maybe a similar thing exists in Linux? 

Back in the late 90s, Linux implemented threads as 'processes' (LinuxThreads), 
but with shared resources such as virtual memory and file descriptors. (The 
Linux kernel's clone system call is highly composable in this regard.) Thus 
getpid() was different for each thread in a process and kill() could target a 
particular thread-process. I guess it was a problem if Ctrl+C in a terminal 
would send SIGINT to every thread-process associated with the terminal.

Eventually, for scalability and POSIX compliance, Linux abandoned the 
LinuxThreads implementation. It evolved kernel process IDs into thread IDs and 
a new concept called a thread group emerged. Nowadays all threads in a process 
are in the same thread group, and the PID returned by getpid() is the 
thread-group ID (TGID), which is the thread ID (TID) of the first thread in the 
process. clone() defaults to creating a new process (thread group), unless 
CLONE_THREAD is specified.

--
nosy: +eryksun

___
Python tracker 

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



[issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster bot (OpenSSL 1.1.1a)

2019-04-12 Thread Steve Dower


Steve Dower  added the comment:

This is still failing regularly - any progress? Do we need to skip tests?

--
nosy: +steve.dower

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-12 Thread STINNER Victor


New submission from STINNER Victor :

On x86-64, clang -O3 compiles the following function:

PyCArgObject *
PyCArgObject_new(void)
{
PyCArgObject *p;
p = PyObject_New(PyCArgObject, &PyCArg_Type);
if (p == NULL)
return NULL;
p->pffi_type = NULL;
p->tag = '\0';
p->obj = NULL;
memset(&p->value, 0, sizeof(p->value));
return p;
}

like that:

   0x7fffe9c6acb0 <+0>: push   rax
   0x7fffe9c6acb1 <+1>: movrdi,QWORD PTR [rip+0xe308]# 
0x7fffe9c78fc0
   0x7fffe9c6acb8 <+8>: call   0x7fffe9c5e8a0 <_PyObject_New@plt>
   0x7fffe9c6acbd <+13>:test   rax,rax
   0x7fffe9c6acc0 <+16>:je 0x7fffe9c6acdf 
   0x7fffe9c6acc2 <+18>:movQWORD PTR [rax+0x20],0x0
   0x7fffe9c6acca <+26>:movBYTE PTR [rax+0x28],0x0
   0x7fffe9c6acce <+30>:xorps  xmm0,xmm0
   0x7fffe9c6acd1 <+33>:movaps XMMWORD PTR [rax+0x30],xmm0
   0x7fffe9c6acd5 <+37>:movQWORD PTR [rax+0x40],0x0
   0x7fffe9c6acdd <+45>:poprcx
   0x7fffe9c6acde <+46>:ret
   0x7fffe9c6acdf <+47>:xoreax,eax
   0x7fffe9c6ace1 <+49>:poprcx
   0x7fffe9c6ace2 <+50>:ret

The problem is that movaps requires the memory address to be aligned on 16 
bytes, whereas PyObject_New() uses pymalloc allocator (the requested size is 80 
bytes, pymalloc supports allocations up to 512 bytes) and pymalloc only 
provides alignment on 8 bytes.

If PyObject_New() returns an address not aligned on 16 bytes, 
PyCArgObject_new() crash immediately with a segmentation fault (SIGSEGV).

CPython must be compiled using -fmax-type-align=8 to avoid such alignment 
crash. Using this compiler flag, clag emits expected machine code:

   0x7fffe9caacb0 <+0>: push   rax
   0x7fffe9caacb1 <+1>: movrdi,QWORD PTR [rip+0xe308]# 
0x7fffe9cb8fc0
   0x7fffe9caacb8 <+8>: call   0x7fffe9c9e8a0 <_PyObject_New@plt>
   0x7fffe9caacbd <+13>:test   rax,rax
   0x7fffe9caacc0 <+16>:je 0x7fffe9caacdf 
   0x7fffe9caacc2 <+18>:movQWORD PTR [rax+0x20],0x0
   0x7fffe9caacca <+26>:movBYTE PTR [rax+0x28],0x0
   0x7fffe9caacce <+30>:xorps  xmm0,xmm0
   0x7fffe9caacd1 <+33>:movups XMMWORD PTR [rax+0x30],xmm0
   0x7fffe9caacd5 <+37>:movQWORD PTR [rax+0x40],0x0
   0x7fffe9caacdd <+45>:poprcx
   0x7fffe9caacde <+46>:ret
   0x7fffe9caacdf <+47>:xoreax,eax
   0x7fffe9caace1 <+49>:poprcx
   0x7fffe9caace2 <+50>:ret

"movaps" instruction becomes "movups" instruction: "a" stands for "aligned" in 
movaps, whereas "u" stands for "unaligned" in movups.

--
components: Build
messages: 340087
nosy: vstinner
priority: normal
severity: normal
status: open
title: clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes
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



  1   2   >