[issue37408] [DOC] Precise that Tarfile "format" argument only concerns writing.

2019-06-26 Thread Pascal Chambon


New submission from Pascal Chambon :

According to https://bugs.python.org/issue30661#msg339300 , "format" argument 
of Tarfile.open() only concerns the writing of files. It's worth mentioning it 
in the doc, if it's True (confirmation from core maintainers is welcome).

--
components: Library (Lib)
messages: 346586
nosy: pakal
priority: normal
severity: normal
status: open
title: [DOC] Precise that Tarfile "format" argument only concerns writing.

___
Python tracker 

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



[issue37408] [DOC] Precise that Tarfile "format" argument only concerns writing.

2019-06-26 Thread Pascal Chambon


Pascal Chambon  added the comment:

PR is on https://github.com/pakal/cpython/pull/1

--

___
Python tracker 

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



[issue37406] Disable runtime checks in release mode

2019-06-26 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Given that extensions call these APIs, I find it highly risky to
disable these checks in any version of the Python runtime and
am -1 on such a change.

Using assert() in C is a pretty bad alternative, since this crashes
the whole process. It should really only be used where no other
means of error handling are possible. Python's exception mechanism
is a much better way to signal and handle such errors at the
application level.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Experts (#1, Jun 26 2019)
>>> Python Projects, Coaching and Consulting ...  http://www.egenix.com/
>>> Python Database Interfaces ...   http://products.egenix.com/
>>> Plone/Zope Database Interfaces ...   http://zope.egenix.com/


::: We implement business ideas - efficiently in both time and costs :::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   http://www.egenix.com/company/contact/
  http://www.malemburg.com/

--
nosy: +lemburg
title: Disable debug runtime checks in release mode -> Disable runtime checks 
in release mode

___
Python tracker 

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



[issue37408] [DOC] Precise that Tarfile "format" argument only concerns writing.

2019-06-26 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
pull_requests: +14203
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14389

___
Python tracker 

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



[issue37408] [DOC] Precise that Tarfile "format" argument only concerns writing.

2019-06-26 Thread Pascal Chambon


Pascal Chambon  added the comment:

My bad, this was a wrongly targeted PR, the real one is here: 
https://github.com/python/cpython/pull/14389

--

___
Python tracker 

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



[issue37163] dataclasses.replace() fails with the field named "obj"

2019-06-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +14204
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/14390

___
Python tracker 

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



[issue37276] Incorrect number of running calls in ProcessPoolExecutor

2019-06-26 Thread Géry

Géry  added the comment:

@Pablo Galindo Salgado

Thank you for the debugging information. I would have expected 8 "Adding a new 
item to the call_queue" instead of 3, since I submitted 8 calls to the process 
pool.

The concurrent.futures._base module defines 5 future states:

> _FUTURE_STATES = [
> PENDING,
> RUNNING,
> CANCELLED,
> CANCELLED_AND_NOTIFIED,
> FINISHED
> ]

The concurrent.futures.process module explains the job flow:

> Local worker thread:
> - reads work ids from the "Work Ids" queue and looks up the corresponding
>   WorkItem from the "Work Items" dict: if the work item has been cancelled 
> then
>   it is simply removed from the dict, otherwise it is repackaged as a
>   _CallItem and put in the "Call Q". New _CallItems are put in the "Call Q"
>   until "Call Q" is full. NOTE: the size of the "Call Q" is kept small because
>   calls placed in the "Call Q" can no longer be cancelled with 
> Future.cancel().
> - reads _ResultItems from "Result Q", updates the future stored in the
>   "Work Items" dict and deletes the dict entry

So for implementation reasons (allowing `Future.cancel()`), submitted calls are 
put in an intermediary unbounded pending dict instead of directly in the call 
queue (which should be the pending queue), and this queue is bounded instead of 
being unbounded. Note that is not the case for the concurrent.futures.thread 
module for which calls are directly submitted to an unbounded call queue 
(pending queue).

And for optimization reasons, the chosen size for this bounded call queue is 
`max_workers + 1` instead of `max_workers`, as defined here:

> # Create communication channels for the executor
> # Make the call queue slightly larger than the number of processes to
> # prevent the worker processes from idling. But don't make it too big
> # because futures in the call queue cannot be cancelled.
> queue_size = self._max_workers + EXTRA_QUEUED_CALLS
> self._call_queue = _SafeQueue(
> max_size=queue_size, ctx=self._mp_context,
> pending_work_items=self._pending_work_items)

and here:

> # Controls how many more calls than processes will be queued in the call 
> queue.
> # A smaller number will mean that processes spend more time idle waiting for
> # work while a larger number will make Future.cancel() succeed less frequently
> # (Futures in the call queue cannot be cancelled).
> EXTRA_QUEUED_CALLS = 1

PENDING calls are put in the call queue until the queue is full:

> while True:
> if call_queue.full():
> return
> try:
> work_id = work_ids.get(block=False)
> except queue.Empty:
> return
> else:
> work_item = pending_work_items[work_id]
> 
> if work_item.future.set_running_or_notify_cancel():
> call_queue.put(_CallItem(work_id,
>  work_item.fn,
>  work_item.args,
>  work_item.kwargs),
>block=True)
> else:
> del pending_work_items[work_id]
> continue

The state of the call is updated to RUNNING right *before* the call is put in 
the call queue by the method `Future.set_running_or_notify_cancel()` instead of 
when the call is consumed from the call queue by a worker process here:

> while True:
> call_item = call_queue.get(block=True)
> if call_item is None:
> # Wake up queue management thread
> result_queue.put(os.getpid())
> return
> try:
> r = call_item.fn(*call_item.args, **call_item.kwargs)
> except BaseException as e:
> exc = _ExceptionWithTraceback(e, e.__traceback__)
> _sendback_result(result_queue, call_item.work_id, exception=exc)
> else:
> _sendback_result(result_queue, call_item.work_id, result=r)
> 
> # Liberate the resource as soon as possible, to avoid holding onto
> # open files or shared memory that is not needed anymore
> del call_item

So when creating a process pool of 2 workers, a call queue of size 3 is 
created. When submitting 8 calls to the pool, all of them are put in a pending 
dict, then 3 of 8 of them are updated from the PENDING state to the RUNNING 
state and put in the call queue, then 2 of 3 are consumed by the 2 workers 
leaving the call queue with 2 empty places and finally 2 of 5 remaining calls 
in the pending dict are updated from the PENDING state to the RUNNING state and 
put in the call queue. So to my understanding, in the end the current 
implementation should show 5 RUNNING states (2 calls currently being executed 
by the 2 workers, 3 calls pending in the call queue).
On MacOS I get these 5 RUNNING states, but sometimes 4. On Windows always 3.
But this is wrong in all cases: the user expects 2, since RUNNING = "being 
executed by a worker process",

[issue37408] [DOC] Precise that Tarfile "format" argument only concerns writing.

2019-06-26 Thread Pascal Chambon


Pascal Chambon  added the comment:

Looking at tarfile.py, "format" seems only used in addfile() indeed.

--

___
Python tracker 

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



[issue37335] Add 646 ASCII alias to locale coercion tests.

2019-06-26 Thread Jakub Kulik


Jakub Kulik  added the comment:

I just added that in the way it was already there but I see why the current 
solution is not the best. Also I wanted to push this into 3.7 only as this 
problem is not present in 3.8 (as discussed in the PR 11195 opened incorrectly 
against the master).

Just to be sure: what you propose is to rewrite current replaces to use 
"codecs.lookup(encoding).name" instead and then push it into the master?
Ok, I will look into it.

--

___
Python tracker 

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



[issue37408] [DOC] Precise that Tarfile "format" argument only concerns writing.

2019-06-26 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +lars.gustaebel, serhiy.storchaka
type:  -> behavior
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



[issue37409] relative import_from without parent

2019-06-26 Thread Ben Lewis


New submission from Ben Lewis :

>>> from curses import ascii
>>> from . import ascii

The second line should raise an ImportError but instead succeeds (tested 
cpython 3.6.7, 3.7.0 and 3.7.3, and from interactive interpreter and scripts). 
Specifically, builtins.__import__ does not reproduce the behaviour of 
importlib._bootstrap.__import__; maybe ceval.c:import_from is neglecting to 
check that there are parent packages when attempting a relative import?

More details here: https://stackoverflow.com/a/56768129/5104777

--
components: Interpreter Core
messages: 346593
nosy: Ben Lewis2
priority: normal
severity: normal
status: open
title: relative import_from without parent
type: behavior
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



[issue37276] Incorrect number of running calls in ProcessPoolExecutor

2019-06-26 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Adding a new state for "not running and not pending but something in between" 
is useless, it can make .running() result a little more accurate but doesn't 
improve the real functionality.

The easy "fix" is documentation updating to point that the value returned by 
running is an approximation. That's true anyway because the future may change 
its state between reading self._state and returning a result.

--

___
Python tracker 

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



[issue37409] relative import_from without parent

2019-06-26 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +brett.cannon, eric.smith

___
Python tracker 

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



[issue36661] Missing dataclass decorator import in dataclasses module docs

2019-06-26 Thread Cheuk Ting Ho


Cheuk Ting Ho  added the comment:

I agree that for the more confusing ones, it would be better to write out the 
import statement explicitly.

--
nosy: +Cheukting

___
Python tracker 

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



[issue37276] Incorrect number of running calls in ProcessPoolExecutor

2019-06-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I concur with Andrew

--

___
Python tracker 

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



[issue37404] asyncio sock_recv blocks on ssl sockets.

2019-06-26 Thread Akshay Takkar


Akshay Takkar  added the comment:

Can you please elaborate on how to get around this issue?

--

___
Python tracker 

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



[issue37404] asyncio sock_recv blocks on ssl sockets.

2019-06-26 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Use asyncio transports or streams.
sock_recv() is a low-level API with a very limited audience.

wrapped ssl socket provides a synchronous interface only.

Perhaps we should raise an exception if SSLSocket is passed into asyncio 
functions.

--

___
Python tracker 

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



[issue37404] asyncio sock_recv blocks on ssl sockets.

2019-06-26 Thread Akshay Takkar


Akshay Takkar  added the comment:

Ah, I see. Yes, raising an exception would probably be very useful. Thanks for 
the info.

--

___
Python tracker 

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



[issue37382] Improve conditional check for test_gdb

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

Depending on the compiler optimization level, gdb may or may not br able to 
read variables and function arguments. IHMO it is fine to skip test_gdb if 
Python "is optimized". I don't think it is worth it to check the exact 
optimizatio level.

The worst debugging experience is provided by PGO build.

--
nosy: +vstinner

___
Python tracker 

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



[issue37382] Improve conditional check for test_gdb

2019-06-26 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> Depending on the compiler optimization level, gdb may or may not br able to 
> read variables and function arguments.

I haven't seen that problem. As I said, all GDB tests pass when compiled with 
"-O3 -g".

> IHMO it is fine to skip test_gdb if Python "is optimized".

The fact that these GDB tests are not run in any CI build is bad. For example, 
we had a buildbot failure after merging PEP 590 because of this. We should try 
to catch test breakage as early as possible, the buildbot should be the last 
resort.

--

___
Python tracker 

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



[issue37335] Add 646 ASCII alias to locale coercion tests.

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

>  what you propose is to rewrite current replaces to use 
> "codecs.lookup(encoding).name" instead and then push it into the master?

I suggest to remove the code which does the .replace(), but instead normalize 
the encoding when checking for the expected encoding (near .assertEqual()). I 
still see the .replace() code in master, so yeah, the code should first be 
changed in master:

@staticmethod
def _handle_output_variations(data):
"""Adjust the output to handle platform specific idiosyncrasies

* Some platforms report ASCII as ANSI_X3.4-1968
* Some platforms report ASCII as US-ASCII
* Some platforms report UTF-8 instead of utf-8
"""
data = data.replace(b"ANSI_X3.4-1968", b"ascii")
data = data.replace(b"US-ASCII", b"ascii")
data = data.lower()
return data

--

___
Python tracker 

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



[issue37410] [Windows] subprocess: close the handle when the process completes

2019-06-26 Thread STINNER Victor


New submission from STINNER Victor :

subprocess.Popen uses _winapi.CreateProcess() to spawn a child process. It 
stores the process handle using a Handle class. Popen never explicitly releases 
the handle, it rely on Handle.__del__ when the Popen object is detroyed (when 
Popen._handle attribute is cleared).

As discussed in bpo-37380, we could call explicitly CloseHandle(handle) as soon 
as the child process completes, to release resources in the Windows kernel.

Attached PR implements this fix.

--
components: Library (Lib)
messages: 346603
nosy: vstinner
priority: normal
severity: normal
status: open
title: [Windows] subprocess: close the handle when the process completes
type: resource usage
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



[issue37410] [Windows] subprocess: close the handle when the process completes

2019-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +14205
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14391

___
Python tracker 

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



[issue37410] [Windows] subprocess: close the handle when the process completes

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

IMHO it's safe to backport PR 14391 to Python 3.7 and 3.8.

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



[issue37405] socket.getsockname() returns string instead of tuple

2019-06-26 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
pull_requests: +14206
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14392

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread Miro Hrončok

New submission from Miro Hrončok :

In Fedora CI, we use the environment variable X to set tests to skip:

https://src.fedoraproject.org/tests/python/blob/bd3ec9505cd37d80fe47fbb8234928abcfc0c658/f/selftest/parallel.sh#_9
 - lines 9 and 21

However, I'Ve realized that testEnviron (test.test_wsgiref.HandlerTests) fails.

Here's a reproducer:

$ python3.7 -m test test_wsgiref 
Run tests sequentially
0:00:00 load avg: 0.75 [1/1] test_wsgiref

== Tests result: SUCCESS ==

1 test OK.

Total duration: 77 ms
Tests result: SUCCESS


$ X=boom python3.7 -m test test_wsgiref 
Run tests sequentially
0:00:00 load avg: 0.71 [1/1] test_wsgiref
test test_wsgiref failed -- Traceback (most recent call last):
  File "/usr/lib64/python3.7/test/test_wsgiref.py", line 567, in testEnviron
self.checkOSEnviron(h)
  File "/usr/lib64/python3.7/test/test_wsgiref.py", line 559, in checkOSEnviron
self.assertEqual(env[k],v)
AssertionError: 'Y' != 'boom'
- Y
+ boom


test_wsgiref failed

== Tests result: FAILURE ==

1 test failed:
test_wsgiref

Total duration: 73 ms
Tests result: FAILURE


I believe that such tests should not be so easily fooled - it should be 
properly isolated or a less common variable name should be used if that is not 
possible, such as PYTHON_TEST_WSGIREF_TMP instead of X.

--
components: Tests
messages: 346605
nosy: hroncok, vstinner
priority: normal
severity: normal
status: open
title: testEnviron (test.test_wsgiref.HandlerTests) fails when environment 
variable X is set
versions: Python 3.6, 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



[issue37380] subprocess.Popen._cleanup() "The handle is invalid" error when some old process is gone

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

> In Unix, the zombie remains visible in the task list (marked as  in 
> Linux), but in Windows an exited process is removed from the Process 
> Manager's active list, so it's no longer visible to users. Also, a Process 
> object is reaped as soon as the last reference to it is closed, since clearly 
> no one needs it anymore. 
> (...)
> We could call self._handle.Close() in _wait(), right after calling 
> GetExitCodeProcess(self._handle). With this change, __exit__ will ensure that 
> _handle gets closed in a deterministic context.

I created bpo-37410 and PR 14391 to close the handle when the process 
completes. IMHO this change is easy and safe, it can be backported to Python 
3.7 and 3.8.

> Code that needs the handle indefinitely can call _handle.Detach() before 
> exiting the with-statement context, but that should rarely be necessary.
> (...)
> There should be a way to indicate a Popen instance is intended to continue 
> running detached from our process, so scripts don't have to ignore an 
> irrelevant resource warning.

My point is that if you want to "detach" a process, it must be *explicit*. In 
my experience, processes are "leaked" implicitly: by mistake. In 
multiprocessing, it can be subtle, you don't manipulate subprocess.Popen 
directly.

Users must not access private attributes (Popen._handle). After I added the 
ResourceWarning, I created bpo-27068 "Add a detach() method to 
subprocess.Popen". But I only created to reply to a request of Martin Panter, I 
didn't use this feature myself. At some point, I decided to just close the 
issue. Maybe it's time to reopen it.


> I don't understand emitting a resource warning in Popen.__del__ if a process 
> hasn't been waited on until completion beforehand (i.e. self.returncode is 
> None). If a script wants to be strict about this, it can use a with 
> statement, which is documented to wait on the process.

The purpose is to help developers to find bugs in their bugs. Many are now 
aware that programs continue to run in the background and that leaking zombie 
processes is an issue on Unix.

The process is not polled to be able to emit the warning in more cases, again, 
to ease debug.

The warning is ignored by default.

--

___
Python tracker 

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



[issue37410] [Windows] subprocess: close the handle when the process completes

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-37380: subprocess.Popen._cleanup() "The handle is invalid" error 
when some old process is gone.

--

___
Python tracker 

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



[issue37382] Improve conditional check for test_gdb

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

> I haven't seen that problem. As I said, all GDB tests pass when compiled with 
> "-O3 -g".

Again, it depends on the optimization level, but IMHO it's not worth it to 
implement an heuristic to check if gdb has enough info to run tests.


> The fact that these GDB tests are not run in any CI build is bad.

gdb is not installed on Travis CI, but test_gdb is run on almost all buildbots.


> We should try to catch test breakage as early as possible, the buildbot 
> should be the last resort.

Maybe open an issue to attempt to install gdb on Travis CI?

test_gdb breakage are quiet rare. If you modify code which can impact test_gdb, 
you can run test_gdb locally. Because breakages are rare, I never invested time 
on this issue: there are more blocking issues in my agenda ;-)

--

___
Python tracker 

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



[issue36167] DOC: Incorrect capitalization in Programming FAQ

2019-06-26 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
versions: +Python 3.9 -Python 3.7

___
Python tracker 

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



[issue36167] DOC: Incorrect capitalization in Programming FAQ

2019-06-26 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
keywords: +easy

___
Python tracker 

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



[issue36168] DOC: Fix capitalization in string.rst

2019-06-26 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
keywords: +easy
versions: +Python 3.9 -Python 3.7

___
Python tracker 

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



[issue37382] Improve conditional check for test_gdb

2019-06-26 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> If you modify code which can impact test_gdb, you can run test_gdb locally

I do run test_gdb locally but it's not very useful since most tests are skipped 
by default because python_is_optimized() is True. That's the whole point of 
this issue: tests are skipped without a good reason.

--

___
Python tracker 

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



[issue37276] Incorrect number of running calls in ProcessPoolExecutor

2019-06-26 Thread Géry

Géry  added the comment:

@Andrew Svetlov

> Adding a new state for "not running and not pending but something in between" 
> is useless

I have not suggested that. I have just reported that when the number of 
submitted calls is strictly greater than the number of pool worker processes, 
the number of RUNNING calls returned by the method `Future.running()` makes no 
sense. Probably because the current `ProcessPoolExecutor` implementation uses 2 
PENDING stores (the `_pending_work_items` `dict` and the `call_queue` 
`multiprocessing.Queue`) but treats the second store as a RUNNING store, 
contrary to the `ThreadPoolExecutor` implementation which has only 1 PENDING 
store (the `_work_queue` `queue.SimpleQueue`). The proper thing to do would be 
to correct the current implementation, not to create a new future state of 
course.

--

___
Python tracker 

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



[issue37276] Incorrect number of running calls in ProcessPoolExecutor

2019-06-26 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I don't mind, sorry.

Feel free to make a pull request with the fix though.

--

___
Python tracker 

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



[issue37382] Improve conditional check for test_gdb

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

> I do run test_gdb locally but it's not very useful since most tests are 
> skipped by default because python_is_optimized() is True.

Ah, I forgot to mention that I always compile Python using:

./configure -C --with-pydebug CFLAGS="-O0" && make

-O0 is not really needed, but sometimes -Og is too aggressive and fails to read 
some symbols. Or maybe it's just me who is not used to -Og yet :-)

I prefer -O0 because the compilation is way faster! But don't use this config 
for benchmarks ;-)

--

___
Python tracker 

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



[issue37402] Fatal Python error: Cannot recover from stack overflow issues on Python 3.6 and 3.7

2019-06-26 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Is it ok to have
  File 
"/home/ajung/sandboxes/ugent-portaal-plone-4x/eggs/Products.CMFDynamicViewFTI-6.0.1-py3.7.egg/Products/CMFDynamicViewFTI/browserdefault.py",
 line 76 in __call__
so many times?
Looks very suspicious

--

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue37386] [EASY] test_io: test_large_file_ops() failed on AMD64 Windows7 SP1 3.x with: [Errno 28] No space left on device

2019-06-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The test requires the "largefile" resource on Windows. If "-u largefile" is 
specified and the test is failed, it is a correct behavior.

The correct solution is either increase the amount of available free disk space 
or remove the "largefile" resource on that buildbot.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +14208
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14394

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 14394 to fix the test.

--

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
versions: +Python 2.7 -Python 3.6

___
Python tracker 

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



[issue37386] [EASY] test_io: test_large_file_ops() failed on AMD64 Windows7 SP1 3.x with: [Errno 28] No space left on device

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

libregrtest usage says:

largefile - It is okay to run some test that may create huge
files.  These tests can take a long time and may
consume >2 GiB of disk space temporarily.

> The test requires the "largefile" resource on Windows. If "-u largefile" is 
> specified and the test is failed, it is a correct behavior.

Ok, but it's a practical issue. How can a buildbot worker maintainer ensure 
that a machine always has 2 GiB of free disk space? Is it really a Python bug 
if the machine has lower than 2 GiB of free space?

--

___
Python tracker 

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



[issue37410] [Windows] subprocess: close the handle when the process completes

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

We may backport the change to Python 2.7 as well, but in this case terminate() 
must be changed to test returncode:

def terminate(self):
"""Terminates the process."""
# Don't terminate a process that we know has already died.
if self.returncode is not None:
return
...

--

___
Python tracker 

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



[issue37410] [Windows] subprocess: close the handle when the process completes

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

terminate() was changed by:

commit a0c9caad66f01328155177180df1c46fe7c62e57
Author: Gregory P. Smith 
Date:   Sun Nov 15 18:19:10 2015 -0800

Fix issue #6973: When we know a subprocess.Popen process has died, do
not allow the send_signal(), terminate(), or kill() methods to do
anything as they could potentially signal a different process.

--

___
Python tracker 

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



[issue37382] Improve conditional check for test_gdb

2019-06-26 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> The worst debugging experience is provided by PGO build.

That's true but unrelated to this issue. We already skip test_gdb completely 
when PGO is enabled.

--

___
Python tracker 

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



[issue37382] Improve conditional check for test_gdb

2019-06-26 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


--
pull_requests: +14209
pull_request: https://github.com/python/cpython/pull/14395

___
Python tracker 

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



[issue37412] os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows

2019-06-26 Thread STINNER Victor


New submission from STINNER Victor :

On Windows, os.getcwdb() is implemented using getcwd() on Windows. This 
function uses the ANSI code page, whereas PEP 529 "Change Windows filesystem 
encoding to UTF-8" is supposed to use UTF-8 for all bytes paths and filenames. 
Moreover, this function emits a DeprecationWarning, whereas PEP 529 was 
supposed to avoid the need to deprecated bytes paths and filenames on Windows.

I guess that it was forgotten in the implementation of the PEP 529. Or was it a 
deliberate choice?

Attached PR modify os.getcwdb() to use UTF-8.

--
components: Library (Lib)
messages: 346620
nosy: steve.dower, vstinner
priority: normal
severity: normal
status: open
title: os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows
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



[issue37412] os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows

2019-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +14210
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14396

___
Python tracker 

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



[issue37412] os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

My PR 14396 modify os.getcwdb() to use UTF-8 and it removes the deprecation 
warning.

--

___
Python tracker 

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



[issue37412] os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows

2019-06-26 Thread Zackery Spytz


Zackery Spytz  added the comment:

See also bpo-32920.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue32920] Implement PEP 529 for os.getcwdb on Windows

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

I just opened the same issue: bpo-37412, but I proposed a PR to implement my 
idea ;-)

--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows

___
Python tracker 

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



[issue37412] os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows

2019-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +eryksun

___
Python tracker 

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



[issue37382] Improve conditional check for test_gdb

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

> That's true but unrelated to this issue. We already skip test_gdb completely 
> when PGO is enabled.

What do you mean? support.PGO is something different: it's only used while 
profiling Python before Python is recompiled a second time.

--

___
Python tracker 

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



[issue37382] Improve conditional check for test_gdb

2019-06-26 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

I meant this part in test_gdb.py:

if ((sysconfig.get_config_var('PGO_PROF_USE_FLAG') or 'xxx') in
(sysconfig.get_config_var('PY_CORE_CFLAGS') or '')):
raise unittest.SkipTest("test_gdb is not reliable on PGO builds")

--

___
Python tracker 

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



[issue37412] os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows

2019-06-26 Thread Steve Dower


Steve Dower  added the comment:

Definitely just an oversight. Thanks for fixing this!

I think it can go to 3.8 as well. Thoughts?

--

___
Python tracker 

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



[issue37382] Improve conditional check for test_gdb

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

If you want to understand why tests are currently skipped when Python is 
optimized, you should dig into the Git history. Not simply remove the decorator 
because it looks wrong to you. There is likely a story behind it.

https://en.wikipedia.org/wiki/Wikipedia:Chesterton's_fence

--

___
Python tracker 

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



[issue37412] os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

> I think it can go to 3.8 as well. Thoughts?

Oh, 3.8 is not released yet. Well, it's more or less a new feature, or a 
bugfix, depending on the point of view.

I would not be comfortable to change the encoding in 3.8.1, but it should be 
fine to do the change in 3.8.

--

___
Python tracker 

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



[issue37412] os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

I retargeted my PR 14396 to Python 3.8.

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



[issue37382] Improve conditional check for test_gdb

2019-06-26 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

These python_is_optimized() tests were added in #8605 and #13628. Those issues 
talk about tests failing when CPython is compiled with -O2 or -O3. But, as I 
said here, I see no problems today with gcc -O3. So I'm guessing that either 
gcc or gdb improved such that these tests pass with more recent versions.

--

___
Python tracker 

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



[issue37413] Deprecate sys._enablelegacywindowsfsencoding()?

2019-06-26 Thread STINNER Victor


New submission from STINNER Victor :

sys._enablelegacywindowsfsencoding() was added late in PEP 529 design "just in 
case" if something goes wrong. But I'm not aware of anyone using it. Do we want 
to keep supporting the *legacy* Windows filesystem encoding (ANSI code page) 
forever? IMHO using UTF-8 is a way more practical solution to design portable 
applications working unmodified on Windows *and* Unix. Well, it's the purpose 
of the PEP 529.

I propose to deprecate sys._enablelegacywindowsfsencoding() and 
PYTHONLEGACYWINDOWSFSENCODING environment variable in Python 3.9 and remove it 
from Python 3.10. Calling sys._enablelegacywindowsfsencoding() would emit a 
DeprecationWarning in 3.9.

I dislike sys._enablelegacywindowsfsencoding() because it can lead to mojibake: 
filenames decoded from the ANSI code page but then encoded to UTF-8. In the PEP 
587 "Python Initialization Configuration" I tried to ensure that encodings are 
set early: in a new "pre-initialization" phase. Encodings should not change 
after the pre-initialization.

--

By the way, I'm not aware of any issue with io._WindowsConsoleIO. Should we 
also deprecated PYTHONLEGACYWINDOWSSTDIO environment variable which opt-out 
from the new io._WindowsConsoleIO?

Extract of open() code in Modules/_io/_iomodule.c:

/* Create the Raw file stream */
{
PyObject *RawIO_class = (PyObject *)&PyFileIO_Type;
#ifdef MS_WINDOWS
PyConfig *config = &_PyInterpreterState_GET_UNSAFE()->config;
if (!config->legacy_windows_stdio && _PyIO_get_console_type(path_or_fd) 
!= '\0') {
RawIO_class = (PyObject *)&PyWindowsConsoleIO_Type;
encoding = "utf-8";
}
#endif
raw = PyObject_CallFunction(RawIO_class,
"OsiO", path_or_fd, rawmode, closefd, 
opener);
}

--
components: Windows
messages: 346631
nosy: ZackerySpytz, eryksun, paul.moore, steve.dower, tim.golden, vstinner, 
zach.ware
priority: normal
severity: normal
status: open
title: Deprecate sys._enablelegacywindowsfsencoding()?
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



[issue37413] Deprecate sys._enablelegacywindowsfsencoding()?

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

> By the way, I'm not aware of any issue with io._WindowsConsoleIO. Should we 
> also deprecated PYTHONLEGACYWINDOWSSTDIO environment variable which opt-out 
> from the new io._WindowsConsoleIO?

It was added to Python 3.6 by PEP 528 "Change Windows console encoding to 
UTF-8".

--

___
Python tracker 

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



[issue37382] Improve conditional check for test_gdb

2019-06-26 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

There is a fleet of buildbots with a variety og versions of gcc and gdb, so if 
a change like that is pushed, all the fleet has to be monitored for potential 
failures, as there are many older OSes supported there.

--
nosy: +cstratak

___
Python tracker 

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



[issue36889] Merge StreamWriter and StreamReader into just asyncio.Stream

2019-06-26 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +14211
pull_request: https://github.com/python/cpython/pull/14397

___
Python tracker 

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



[issue37414] Remove sys.callstats()

2019-06-26 Thread STINNER Victor


New submission from STINNER Victor :

In Python 3.6, sys.callstats() was a way to retrieve statistics produced by 
Python/ceval.c when Python was compiled with a special build option: 
CALL_PROFILE. The function was implemented with PyEval_GetCallStats().


I removed CALL_PROFILE special build and deprecated sys.callstats() in 
bpo-28799:

commit a61a54b149cfcbcee15b37f557be730f0e30b6ad
Author: Victor Stinner 
Date:   Mon Nov 28 12:06:13 2016 +0100

Issue #28799: Update Misc/SpecialBuilds.txt

Remove CALL_PROFILE.


sys.callstats() always returned None since Python 3.7.


Attached PR removed sys.callstats().

--
components: Interpreter Core
messages: 346634
nosy: vstinner
priority: normal
severity: normal
status: open
title: Remove sys.callstats()
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



[issue37380] subprocess.Popen._cleanup() "The handle is invalid" error when some old process is gone

2019-06-26 Thread Eryk Sun


Eryk Sun  added the comment:

> The process is not polled to be able to emit the warning in more 
> cases, again, to ease debug.

It emits an incorrect warning if the process has already exited: "subprocess %s 
is still running". This can be rectified. Here's my current understanding:

def __del__(self, _maxsize=sys.maxsize, _warn=warnings.warn):
if not self._child_created or self.returncode is not None:
return
# In Unix, not reading the subprocess exit status creates a zombie
# process, which is only destroyed at the parent Python process exit.
# In Windows, no one else should have a reference to our _handle, so
# it should get finalized and thus closed, but we use the same warning
# in order to consistently educate developers.
if self._internal_poll(_deadstate=_maxsize) is not None:
_warn("subprocess %s was implicitly finalized" % self.pid,
  ResourceWarning, source=self)
else:
_warn("subprocess %s is still running" % self.pid,
  ResourceWarning, source=self)
# Keep this instance alive until we can wait on it, if needed.
if _active is not None:
_active.append(self)

--

___
Python tracker 

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



[issue37414] Remove undocumented and deprecated sys.callstats() function

2019-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +14212
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14398

___
Python tracker 

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



[issue37414] Remove undocumented and deprecated sys.callstats() function

2019-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
title: Remove sys.callstats() -> Remove undocumented and deprecated 
sys.callstats() function

___
Python tracker 

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



[issue37412] os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 689830ee6243126798a6c519c05aa11ba73db7cd by Victor Stinner in 
branch 'master':
bpo-37412: os.getcwdb() now uses UTF-8 on Windows (GH-14396)
https://github.com/python/cpython/commit/689830ee6243126798a6c519c05aa11ba73db7cd


--

___
Python tracker 

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



[issue37412] os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows

2019-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14213
pull_request: https://github.com/python/cpython/pull/14399

___
Python tracker 

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



[issue37415] Error build Python with Intel compiler

2019-06-26 Thread Borja


New submission from Borja :

I'm trying to build Python 3.7 on CentOS 7 with Intel compilers. To compile I 
do the following:

export CC=icc
export CXX=icpc
export FC=ifort

./configure --prefix=my_prefix --enable-optimizations --without-gcc
make
make install

In the configure, no error is seen, but when I execute make, the following 
message is printed:

Running code to generate profile data (this can take a while):
# First, we need to create a clean build with profile generation
# enabled.
make profile-gen-stamp
make[1]: se ingresa al directorio `/home/python/source/Python-3.7.3'
Building with support for profile generation:
make build_all_generate_profile
make[2]: se ingresa al directorio `/home/python/source/Python-3.7.3'
make build_all CFLAGS_NODIST=" -prof-gen" LDFLAGS_NODIST=" -prof-gen" 
LIBS="-lcrypt -lpthread -ldl  -lutil"
make[3]: se ingresa al directorio `/home/python/source/Python-3.7.3'
icc -pthread -c -Wsign-compare -Wunreachable-code -DNDEBUG -g  -O3 -Wall
-std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers 
-Wno-cast-function-type -Werror=implicit-function-declaration -fp-model strict 
-prof-gen  -I. -I./Include-DPy_BUILD_CORE -o Programs/python.o 
./Programs/python.c
icc: command line warning #10006: ignoring unknown option 
'-Wno-cast-function-type'
In file included from ./Include/Python.h(75),
 from ./Programs/python.c(3):
./Include/pyatomic.h(39): error: identifier "atomic_uintptr_t" is undefined
  atomic_uintptr_t _value;
  ^

compilation aborted for ./Programs/python.c (code 2)

--
messages: 346637
nosy: Saszalez
priority: normal
severity: normal
status: open
title: Error build Python with Intel compiler
type: compile error

___
Python tracker 

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



[issue37380] subprocess.Popen._cleanup() "The handle is invalid" error when some old process is gone

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

Sorry, I'm lost :-( More and more different issues are discussed here. Would it 
be possible please to stick this issue to _active list and _cleanup() on 
Windows? From what I read, remove/disable _active and _cleanup() makes sense on 
Windows.

I already created bpo-37410 to call CloseHandle() earlier.

Eryk: Please open a separated issue if you want to change the ResourceWarning 
message.

--

___
Python tracker 

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



[issue37415] Error build Python with Intel compiler

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

atomic_uintptr_t is used if HAVE_STD_ATOMIC defined is defined. Can you please 
check in pyconfig.h if it's defined?

So  doesn't provide atomic_uintptr_t with ICC?

--
nosy: +vstinner

___
Python tracker 

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



[issue37413] Deprecate sys._enablelegacywindowsfsencoding()?

2019-06-26 Thread Steve Dower


Steve Dower  added the comment:

It's probably worth at least a post to python-dev to expand the audience, but 
unless someone speaks up with some really good reason why they must update to 
Python 3.10 without updating their own code then let's deprecate it.

FWIW, even with the flag the behaviour changed in 3.6. Previously it would use 
the *A APIs and let Windows do the encoding, but then it changed to the *W APIs 
and Python would encode with our own mbcs:replace, where mbcs is just calling 
through to the WideCharToMultiByte API. So there isn't really anything to 
maintain long term apart from the additional options.

--

___
Python tracker 

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



[issue37386] [EASY] test_io: test_large_file_ops() failed on AMD64 Windows7 SP1 3.x with: [Errno 28] No space left on device

2019-06-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The test suite fails if there is less than 500 or 600 MB of RAM, not counting 
bigmem tests. It is not a Python bug, but an environment issue. A buildbot 
worker should have some free disk space and RAM, and set tests running options 
correspondingly.

--

___
Python tracker 

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



[issue37386] [EASY] test_io: test_large_file_ops() failed on AMD64 Windows7 SP1 3.x with: [Errno 28] No space left on device

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

Serhiy:
> The test suite fails if there is less than 500 or 600 MB of RAM, not counting 
> bigmem tests. It is not a Python bug, but an environment issue. A buildbot 
> worker should have some free disk space and RAM, and set tests running 
> options correspondingly.

How do you plan to fix buildbots? Contact each buildbot owner and asks them to 
ensure that largefile is only used with at least 2 GiB of free space? And maybe 
install monitor to get an alarm if it's no longer the case?

Maybe some buildbot owners will just remove largefile, which would not be the 
expected reaction, no?

--

___
Python tracker 

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



[issue37406] Disable runtime checks in release mode

2019-06-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think that the public C API should have runtime checks for its arguments, 
except performance sensitive functions and macros (like PyTuple_GET_ITEM). The 
internal C API can use just asserts.

I have a work-in-progress patch which adds tests for the public C API, 
including calls with invalid arguments.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue37414] Remove undocumented and deprecated sys.callstats() function

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 69150669f224a1fc47de483557736e725ac5b2a1 by Victor Stinner in 
branch 'master':
bpo-37414: Remove sys.callstats() (GH-14398)
https://github.com/python/cpython/commit/69150669f224a1fc47de483557736e725ac5b2a1


--

___
Python tracker 

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



[issue37386] [EASY] test_io: test_large_file_ops() failed on AMD64 Windows7 SP1 3.x with: [Errno 28] No space left on device

2019-06-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yes, it is a solution.

In this particular case it may be that the disk is fulled by test files leaked 
from the past test runs.

--

___
Python tracker 

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



[issue28799] Drop CALL_PROFILE special build?

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

I removed the function from Python 3.9 in bpo-37414.

--

___
Python tracker 

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



[issue37163] dataclasses.replace() fails with the field named "obj"

2019-06-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2d88e63bfcf7bccba925ab80b3f47ccf8b7aefa8 by Serhiy Storchaka in 
branch 'master':
bpo-37163: Make the obj argument of dataclasses.replace() a positional-only. 
(GH-14390)
https://github.com/python/cpython/commit/2d88e63bfcf7bccba925ab80b3f47ccf8b7aefa8


--

___
Python tracker 

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



[issue37414] Remove undocumented and deprecated sys.callstats() function

2019-06-26 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



[issue37412] os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows

2019-06-26 Thread miss-islington


miss-islington  added the comment:


New changeset 63429c839b19c6fe604deddcb12497443ca01a9a by Miss Islington (bot) 
in branch '3.8':
bpo-37412: os.getcwdb() now uses UTF-8 on Windows (GH-14396)
https://github.com/python/cpython/commit/63429c839b19c6fe604deddcb12497443ca01a9a


--
nosy: +miss-islington

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5150d327924959639215ed0a78feffc0d88258da by Victor Stinner in 
branch 'master':
bpo-37411: Rewrite test_wsgiref.testEnviron() (GH-14394)
https://github.com/python/cpython/commit/5150d327924959639215ed0a78feffc0d88258da


--

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14214
pull_request: https://github.com/python/cpython/pull/14402

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14215
pull_request: https://github.com/python/cpython/pull/14403

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14216
pull_request: https://github.com/python/cpython/pull/14404

___
Python tracker 

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



[issue37163] dataclasses.replace() fails with the field named "obj"

2019-06-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +14217
pull_request: https://github.com/python/cpython/pull/14405

___
Python tracker 

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



[issue37179] asyncio loop.start_tls() provide support for TLS in TLS

2019-06-26 Thread Cooper Lees


Cooper Lees  added the comment:

@fantix - Is there anything I can do to help this progress. I'd be happy to 
potentially even do parts of the back porting if you're swamped. Would just 
need some guidance.

I need this as I'm looking to add auth to some internal HTTP(S) proxies I use 
and in order to allow aiohttp to be able to do client TLS auth, this is 
required.

--

___
Python tracker 

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



[issue37376] pprint for types.SimpleNamespace

2019-06-26 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

+1 This would be a nice improvement.

--
nosy: +rhettinger

___
Python tracker 

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



[issue37390] Generate table of audit events for docs

2019-06-26 Thread Steve Dower


Change by Steve Dower :


--
keywords: +patch
pull_requests: +14218
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/14406

___
Python tracker 

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



[issue37390] Generate table of audit events for docs

2019-06-26 Thread Steve Dower


Steve Dower  added the comment:

I think my PR is ready. I had to go through and update all the audit-event tags 
that existed, since the argument parsing in Sphinx didn't work the way I first 
thought it did, but now we can provide a back reference manually (or let it 
auto-generate one to the line with the event).

I also updated some of the event names I recently added so they are more 
consistent with the existing ones - e.g. poplib.POP3 -> poplib.connect for 
consistency with socket.connect.

--

___
Python tracker 

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



[issue37416] If threading is not imported from the main thread it sees the wrong thread as the main thread.

2019-06-26 Thread Fabio Zadrozny


New submission from Fabio Zadrozny :

I'm attaching a snippet which shows the issue (i.e.: threading.main_thread() 
and threading.current_thread() should be the same and they aren't).

What I'd see as a possible solution is that the initial thread ident would be 
stored when the interpreter is initialized and then when threading is imported 
the first time it would get that indent to initialize the main thread instead 
of calling `threading._MainThread._set_ident` in the wrong thread.

I'm not sure if this is possible if CPython is embedded in some other C++ 
program, but it seems to be the correct approach when Python is called from the 
command line.

As a note, I found this when doing an attach to pid for the `pydevd` debugger 
where a thread is created to initialize the debugger (the issue on the debugger 
is reported at: https://github.com/microsoft/ptvsd/issues/1542).

--
components: Interpreter Core
files: snippet.py
messages: 346653
nosy: fabioz
priority: normal
severity: normal
status: open
title: If threading is not imported from the main thread it sees the wrong 
thread as the main thread.
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48438/snippet.py

___
Python tracker 

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



[issue37409] relative import_from without parent

2019-06-26 Thread Brett Cannon


Brett Cannon  added the comment:

I can't reproduce:

>>> from importlib import abc
>>> from . import util
Traceback (most recent call last):
  File "", line 1, in 
ImportError: cannot import name 'util' from '__main__' (unknown location)
>>> import importlib.util
>>>

Did you happen to do an `import *` prior to this in your REPL? If so that might 
explain it as you could have pulled in __package__ and such and that's used to 
resolve relative imports.

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

___
Python tracker 

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



[issue37417] bytearray.extend does not handle errors during iteration.

2019-06-26 Thread Brandt Bucher


Change by Brandt Bucher :


--
keywords: +patch
pull_requests: +14219
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14407

___
Python tracker 

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



[issue37417] bytearray.extend does not handle errors during iteration.

2019-06-26 Thread Brandt Bucher


New submission from Brandt Bucher :

bytearray.extend doesn't properly handle errors that arise during iteration of 
the argument:

Python 3.9.0a0 (heads/master:5150d32, Jun 26 2019, 10:55:32) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> array = bytearray()
>>> bad_iter = map(int, "X")
>>> array.extend(bad_iter)
ValueError: invalid literal for int() with base 10: 'X'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 1, in 
SystemError:  returned a result with an 
error set

As far as I can tell, this bug is present on all versions of Python 3. I've 
attached a patch with a fix and a regression test.

--
components: Interpreter Core
messages: 346655
nosy: brandtbucher
priority: normal
severity: normal
status: open
title: bytearray.extend does not handle errors during iteration.
type: behavior
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



[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2019-06-26 Thread Brett Cannon


Brett Cannon  added the comment:

PEPs are not living documents unless they are marked as Active (which PEP 451 
is not).

--

___
Python tracker 

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



[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2019-06-26 Thread Anthony Sottile


Anthony Sottile  added the comment:

Where can I find up to date best practices / docs for the import machinery? I 
couldn't find a mention of this in docs.python.org

--

___
Python tracker 

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



[issue37369] Issue with pip in venv on Powershell in Windows

2019-06-26 Thread Steve Dower


Steve Dower  added the comment:

Okay, this definitely used to work, but now it's broken for me too.

What version of Windows are you on (copy-paste from cmd.exe's ver command)?

--

___
Python tracker 

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



[issue37391] MacOS Touchpad scrolling crashes IDLE

2019-06-26 Thread Ned Deily


Ned Deily  added the comment:

> Does IDLE every run long enough with Apple's tk before failure to make 
> continuing useful?

Yes, depending on what you are doing, IDLE *may* run just fine with the system 
Tk.  But you may may run into this issue depending on how you scroll.  Or, 
among the worst bugs, if you try to type in characters not directly available 
on the keyboard by using one of the available composition characters, like 
opt-u followed by a vowel to produced an "umlauted" vowel with the US keyboard 
layout, Tk will immediately crash taking IDLE with it and with no opportunity 
to save any work in progress.  Many people will not run into those bugs but it 
can be very painful to those who do.

> Any comments here before I open a new issue?

I don't think changing the message is going to make much of a difference.  
There isn't much an end user can do other to avoid the known behaviors that 
cause problems, install another version of Python (which may not be an option 
for many novice users), or not use IDLE.  Back when we did not ship our own 
copy of Tcl/Tk with the python.org macOS installers, there *was* something else 
you might be able to do: install a more up-to-date third-party Tcl/Tk that 
would then be automatically used. But that's not longer an option nor is it 
needed.

I think the best thing we can do is help make it easier for people building 
Python to not link with the broken system Python and improve the using Python 
on macOS documentation.  I have issues opened for both of those.

--

___
Python tracker 

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



  1   2   >