[issue32251] Add asyncio.BufferedProtocol

2017-12-11 Thread INADA Naoki

INADA Naoki  added the comment:

Looks nice.  Can it speed up aiohttp 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



[issue32251] Add asyncio.BufferedProtocol

2017-12-11 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Yes.
aiohttp uses own streams but public API and internal implementation are pretty 
close to asyncio streams.
Moreover C accelerated HTTP parser should work with proposed BufferedProtocol 
seamlessly.

--

___
Python tracker 

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



[issue30718] open builtin function: specifying the size of buffer has no effect for text files

2017-12-11 Thread Nitish

Change by Nitish :


--
nosy: +nitishch

___
Python tracker 

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



[issue32228] truncate() changes current stream position

2017-12-11 Thread Nitish

Change by Nitish :


--
nosy: +nitishch

___
Python tracker 

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



[issue32274] Potential leak in pysqlite_connection_init()

2017-12-11 Thread Lele Gaifax

New submission from Lele Gaifax :

The function calls ``sqlite3_open()`` that, if I understand its documentation 
correctly[#], returns a new connection object in all cases (that is, even on 
errors) with the only exception of "out of memory" (in which case it sets the 
second parameter to ``NULL``).

I think that the new connection object should be immediately released in case 
of errors, passing it to ``sqlite3_close()``.

.. [#] http://sqlite.org/c3ref/open.html

--
messages: 308021
nosy: lelit
priority: normal
severity: normal
status: open
title: Potential leak in pysqlite_connection_init()
type: resource usage

___
Python tracker 

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



[issue27645] Supporting native backup facility of SQLite

2017-12-11 Thread Lele Gaifax

Lele Gaifax  added the comment:

I need advice on Serhiy's proposal of dropping support to plain file name (see 
also https://github.com/python/cpython/pull/4238#discussion_r155725986).

Wrt the other point I filed issue #32274.

--

___
Python tracker 

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



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2017-12-11 Thread Nathaniel Smith

Change by Nathaniel Smith :


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



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2017-12-11 Thread Giampaolo Rodola'

Change by Giampaolo Rodola' :


--
nosy:  -giampaolo.rodola

___
Python tracker 

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



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2017-12-11 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

PR 4793 provides everything that Jinja2 and Trio actually need right now. It 
doesn't provide any way to annotate tracebacks with extra data, but I'm not 
entirely sure if that's necessary or what it would look like, so I figured I'd 
at least get this part in for 3.7.

--

___
Python tracker 

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



[issue32274] Potential leak in pysqlite_connection_init()

2017-12-11 Thread Julien Palard

Julien Palard  added the comment:

I don't see a leak here: as long as nobody keep a reference to each connection 
objects, pysqlite_connection_dealloc will be called and will call the 
sqlite3_close.

In other words the sqlite3_close is called when the connection is destroyed, 
which happen when no reference are kept on the connection, indifferently of a 
success or a failure of the connection.

It's in Modules/_sqlite/connection.c

--
nosy: +mdk

___
Python tracker 

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



[issue32274] Potential leak in pysqlite_connection_init()

2017-12-11 Thread Lele Gaifax

Lele Gaifax  added the comment:

You are right, thank you.

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

___
Python tracker 

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



[issue32275] SSL socket methods don't retry on EINTR?

2017-12-11 Thread Antoine Pitrou

New submission from Antoine Pitrou :

Some time ago, PEP 475 was accepted in order to automatically retry system 
calls on EINTR, but the _ssl module wasn't touched.

However, it seems that OpenSSL socket calls can fail with EINTR:
https://stackoverflow.com/questions/24188013/openssl-and-signals

--
messages: 308026
nosy: alex, christian.heimes, dstufft, janssen, njs, pitrou, vstinner
priority: normal
severity: normal
status: open
title: SSL socket methods don't retry on EINTR?
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



[issue32251] Add asyncio.BufferedProtocol

2017-12-11 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

See https://eklitzke.org/goroutines-nonblocking-io-and-memory-usage for an 
interesting discussion of the drawbacks of some buffer handling idioms.

--

___
Python tracker 

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



[issue32275] SSL socket methods don't retry on EINTR?

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

"it seems that OpenSSL socket calls can fail with EINTR: ..."

You are easily test by raising a signal: see Lib/test/test_eintr.py which 
stress Python functions by sending a signal every 100 ms while Python is 
blocked in a syscall.

If there is a bug, sure, it must be fixed ;-)

It was very tricky to handle EINTR properly in the socket module. While most 
Python functions are thin wrapper to syscalls with no timeout, almost every 
socket functions have a timeout. So I wrote sock_call() to factorize the code. 
This function calls select() internally to check if the socket is "ready", but 
also updates the timeout, etc.

A few other Python are retried on EINTR and update a timeout, like 
select.select(), time.sleep(), threading.Lock.acquire() and 
signal.sigtimedwait().

--

___
Python tracker 

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



[issue32275] SSL socket methods don't retry on EINTR?

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

See bpo-23618 for handling EINTR in socket and bpo-23834 for sock_call().

--

___
Python tracker 

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



[issue32246] test_regrtest alters the execution environment on Android

2017-12-11 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

To debug and reproduce the problem on Android, one must checkout from the 
bpo-30386 branch 
https://github.com/python/cpython/pull/1629/commits/c0ca089220cd39851d7625b55510be63b340e188.

faulthandler._sigsegv() does crash the crasher in test_crashed, so test_crashed 
must not be disabled.

> How is it possible that the new file that alters the environment be a 
> test_python_* directory (see my initial post) when all the tests are run 
> inside a TEMPDIR/test_python_* directory.

Both test_crashed tests are run in nested tests directories (i.e. in 
$TEMPDIR/test_python_*/test_python_*) on Android. As a consequence the 
test_python_* directory that is not removed by the crasher because it crashed, 
is reported by test_crashed as altering the environment. This also explains the 
other points raised previously.

A remote interactive shell is run by the 'adb shell' command and the TMPDIR 
environment variable is set in that shell. A command may be run remotely with 
the command 'adb shell /path/to/command' and the TMPDIR variable is *not set* 
(but most if not all the other shell environment variables are set) and since 
on Android /tmp does not exist, then tempfile.gettempdir() uses the current 
directory. This explains why the test directories are doubly nested.

On the commit that is the child of commit c0ca089220cd39... which we are using 
here, TMPDIR has been made to be set in the script that runs 
Tools/script/run_tests.py and so it does fix inadvertently the issue for the 
reason explained in the previous paragraph.

This bug can only exist on platforms where tempfile.gettempdir() falls back to 
using the current directory because '/tmp', '/var/tmp' and '/usr/tmp' do not 
exist and where none of the 'TMPDIR', 'TEMP', 'TMP' variables is set. Therefore 
we can either close this issue as not a bug or use the following patch that 
fixes the problem, it is similar to the fix made in issue 15300:

diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
index 8364767b3a..3a213e12c4 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -468,10 +468,13 @@ class BaseTestCase(unittest.TestCase):
 input = ''
 if 'stderr' not in kw:
 kw['stderr'] = subprocess.PIPE
+savedcwd = (support.SAVEDCWD if
+any(x.startswith('-j') for x in args) else None)
 proc = subprocess.run(args,
   universal_newlines=True,
   input=input,
   stdout=subprocess.PIPE,
+  cwd=savedcwd,
   **kw)
 if proc.returncode != exitcode:
 msg = ("Command %s failed with exit code %s\n"

--

___
Python tracker 

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



[issue32275] SSL socket methods don't retry on EINTR?

2017-12-11 Thread Christian Heimes

Change by Christian Heimes :


--
assignee:  -> christian.heimes
components: +SSL
stage:  -> needs patch

___
Python tracker 

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



[issue32275] SSL socket methods don't retry on EINTR?

2017-12-11 Thread Christian Heimes

Change by Christian Heimes :


--
assignee: christian.heimes -> 

___
Python tracker 

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



[issue32275] SSL socket methods don't retry on EINTR?

2017-12-11 Thread Julien Palard

Julien Palard  added the comment:

Looks like this behavior is documented in the bio_should_retry(3) man page.

Basically bio_should_retry() tells if the error was non-fatal:

int BIO_fd_should_retry(int i)
{
int err;

if ((i == 0) || (i == -1)) {
err = get_last_sys_error();

return BIO_fd_non_fatal_error(err);
}
return 0;
}

--
nosy: +mdk

___
Python tracker 

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



[issue32252] test_regrtest leaves a test_python_* directory in TEMPDIR

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

I'm unable to reproduce the issue on Fedora 27:

vstinner@apu$ cat /proc/sys/kernel/core_pattern 
core-%e.%s
vstinner@apu$ ulimit -c
unlimited
vstinner@apu$ ./python -m test test_regrtest
Run tests sequentially
0:00:00 load avg: 0.70 [1/1] test_regrtest
1 test OK.

Total duration: 14 sec
Tests result: SUCCESS


While core dump works as expected:

vstinner@apu$ ./python
>>> import faulthandler
>>> faulthandler._sigsegv()
Segmentation fault (core dumped)
vstinner@apu$ ls core*
core-python.11.32456

--

___
Python tracker 

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



[issue32252] test_regrtest leaves a test_python_* directory in TEMPDIR

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

Ah! I misunderstood the bug report. I was looking for a ENV_FAILED failure, but 
no, regrtest fails to remove its temporary directory but no warning is emitted 
in this case.

vstinner@apu$ ls -d build/test_python_*; ./python -m test test_regrtest -m 
test.test_regrtest.ArgsTestCase.test_crashed; ls -d build/test_python_*
ls: impossible d'accéder à 'build/test_python_*': No such file or directory

Run tests sequentially
0:00:00 load avg: 0.42 [1/1] test_regrtest
1 test OK.

Total duration: 537 ms
Tests result: SUCCESS

build/test_python_816


So running test_regrtest creates build/test_python_816/ but fails to remove it 
because it contains a core dump: core-python.11.816.

* No core dump must be written, Python is supposed to disable that
* regrtest must emit a warning if it fails to remove the temporary directory, 
maybe also fail with an error? (non-zero exit code)

--

___
Python tracker 

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



[issue32252] test_regrtest leaves a test_python_* directory in TEMPDIR

2017-12-11 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

What is now the content of the 'build/' subdirectory of the source tree ?

--

___
Python tracker 

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



[issue32252] test_regrtest leaves a test_python_* directory in TEMPDIR

2017-12-11 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

> Ah! I misunderstood the bug report. I was looking for a ENV_FAILED failure, 
> but no, regrtest fails to remove its temporary directory but no warning is 
> emitted in this case.

Yes :-)

--

___
Python tracker 

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



[issue32252] test_regrtest leaves a test_python_* directory in TEMPDIR

2017-12-11 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

> So running test_regrtest creates build/test_python_816/ but fails to remove 
> it because it contains a core dump: core-python.11.816.

Not sure that it is because it contains a core file. Maybe it just does not 
remove it because the test crashed ?

--

___
Python tracker 

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



[issue32252] test_regrtest leaves a test_python_* directory in TEMPDIR

2017-12-11 Thread STINNER Victor

Change by STINNER Victor :


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



[issue32252] test_regrtest leaves a test_python_* directory in TEMPDIR

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

> Maybe it just does not remove it because the test crashed ?

Ah, you're right :-)

--

___
Python tracker 

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



[issue32252] test_regrtest leaves a test_python_* directory in TEMPDIR

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

> * No core dump must be written, Python is supposed to disable that

My bad. It's an obvious bug that was missed before because regrtest creates a 
temporary directory to run tests and then remove it.

I wrote the PR 4794 to fix faulthandler.

--

___
Python tracker 

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



[issue32252] test_regrtest leaves a test_python_* directory in TEMPDIR

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 48d4dd974f0c8d47c54990eedd322b96b19c60ec by Victor Stinner in 
branch 'master':
bpo-32252: Fix faulthandler_suppress_crash_report() (#4794)
https://github.com/python/cpython/commit/48d4dd974f0c8d47c54990eedd322b96b19c60ec


--

___
Python tracker 

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



[issue32252] test_regrtest leaves a test_python_* directory in TEMPDIR

2017-12-11 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4694

___
Python tracker 

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



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2017-12-11 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



[issue26855] android: add platform.android_ver()

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

> Yes, and fall back to spawning getprop if that fails.

I suggest to start simple. Parsing a text file is simple, spawning a subprocess 
can have annoying side effects :-(

--

___
Python tracker 

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



[issue32252] test_regrtest leaves a test_python_* directory in TEMPDIR

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 71d8f36eb450cdbc4b5397e25f6f3f5d676aca79 by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
bpo-32252: Fix faulthandler_suppress_crash_report() (GH-4794) (#4795)
https://github.com/python/cpython/commit/71d8f36eb450cdbc4b5397e25f6f3f5d676aca79


--

___
Python tracker 

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



[issue22671] Typo in class io.BufferedIOBase docs

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 1b74f9b77a6fa1d7828986cb79d5b10942ff9141 by Victor Stinner 
(Sanyam Khurana) in branch 'master':
bpo-22671: Clarify and test default read method implementations (#4568)
https://github.com/python/cpython/commit/1b74f9b77a6fa1d7828986cb79d5b10942ff9141


--
nosy: +vstinner

___
Python tracker 

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



[issue22671] Typo in class io.BufferedIOBase docs

2017-12-11 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4695

___
Python tracker 

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



[issue32276] there is no way to make tempfile reproducible (i.e. seed the used RNG)

2017-12-11 Thread Yaroslav Halchenko

New submission from Yaroslav Halchenko :

It is quite often desired to reproduce the same failure identically. In many 
cases sufficient to seed the shared random._inst (via random.seed). tempfile 
creates new instance(s) for its own operation and does not provide API to seed 
it.  I do not think it would be easy (unless I miss some pattern) to make it 
deterministic/reproducible for multi-process apps, but I wondered why initially 
(for the main process) tempfile module doesn't just reuse the random._inst 
while only creating a new _Random in children processes?
Another alternative solution would be to allow to specify seed for all those 
mkstemp/mkdtemp/... and pass it all way to _RandomNameSequence which would 
initialize _Random with it.  This way, developers who need to seed it, could do 
so

--
messages: 308043
nosy: Yaroslav.Halchenko
priority: normal
severity: normal
status: open
title: there is no way to make tempfile reproducible (i.e. seed the used RNG)

___
Python tracker 

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



[issue22671] Typo in class io.BufferedIOBase docs

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 0aa2a1d003b476b954ecdcb7e966bf7f0b75a06b by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
bpo-22671: Clarify and test default read method implementations (GH-4568) 
(#4796)
https://github.com/python/cpython/commit/0aa2a1d003b476b954ecdcb7e966bf7f0b75a06b


--

___
Python tracker 

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



[issue22671] Typo in class io.BufferedIOBase docs

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

Thank you Martin Panter and Sanyam Khurana for the fix.

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



[issue29302] add contextlib.AsyncExitStack

2017-12-11 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Looks like AbstractAsyncContextManager is defined in issue #30241.

--

___
Python tracker 

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



[issue31650] implement PEP 552

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

Failure on Python on s390x RHEL 3.x:

http://buildbot.python.org/all/#/builders/21/builds/340

==
FAIL: test_source_hash (test.test_imp.ImportTests)
--
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/test_imp.py", 
line 335, in test_source_hash
self.assertEqual(_imp.source_hash(42, b'hi'), b'\xc6\xe7Z\r\x03:}\xab')
AssertionError: b'Yb\x91||\x91bY' != b'\xc6\xe7Z\r\x03:}\xab'

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue32272] Remove asyncio.async function

2017-12-11 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 9edad3c7011ccab0a66a065933abebf3288cf1a1 by Yury Selivanov in 
branch 'master':
bpo-32272: Remove asyncio.async() function. (#4784)
https://github.com/python/cpython/commit/9edad3c7011ccab0a66a065933abebf3288cf1a1


--

___
Python tracker 

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



[issue32272] Remove asyncio.async function

2017-12-11 Thread Yury Selivanov

Change by Yury Selivanov :


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



[issue32273] Remove asyncio.test_utils

2017-12-11 Thread Yury Selivanov

Change by Yury Selivanov :


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



[issue32273] Remove asyncio.test_utils

2017-12-11 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 3e9751819ad13a965e8be13c1e5bc5a6811fe6b8 by Yury Selivanov in 
branch 'master':
bpo-32273: Move asyncio.test_utils to test.test_asyncio (#4785)
https://github.com/python/cpython/commit/3e9751819ad13a965e8be13c1e5bc5a6811fe6b8


--

___
Python tracker 

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



[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-11 Thread Licht Takeuchi

Licht Takeuchi  added the comment:

PR is now fixed so as to follow the behavior on Python 2.7!

--

___
Python tracker 

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



[issue32269] Add `asyncio.get_running_loop()` function

2017-12-11 Thread Yury Selivanov

Change by Yury Selivanov :


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



[issue32269] Add `asyncio.get_running_loop()` function

2017-12-11 Thread Yury Selivanov

Yury Selivanov  added the comment:

> `asyncio._get_running_loop()` will be deprecated and removed in Python 3.9.

_get_running_loop() was left as-is.

--

___
Python tracker 

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



[issue32258] Rewrite asyncio docs to use async/await syntax

2017-12-11 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset 8874342cf332c3aa3d845155cc4b41b00c2d9e9d by Andrew Svetlov in 
branch 'master':
bpo-32258: Replace 'yield from' to 'await' in asyncio docs (#4779)
https://github.com/python/cpython/commit/8874342cf332c3aa3d845155cc4b41b00c2d9e9d


--

___
Python tracker 

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



[issue19431] Document PyFrame_FastToLocals() and PyFrame_FastToLocalsWithError()

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

> Should there be a PR for this?

Feel free to create a PR from my old (4 years old) patch. Just mention my name 
in the commit message please.

--

___
Python tracker 

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



[issue19431] Document PyFrame_FastToLocals() and PyFrame_FastToLocalsWithError()

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

> PyFrame_FastToLocals() and PyFrame_LocalsToFast() are not documented and have 
> weird interface. I think the use of them should be discouraged.

I suggest to document them, but explain in the documentation that they must not 
be used :-)

--

___
Python tracker 

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



[issue19431] Document PyFrame_FastToLocals() and PyFrame_FastToLocalsWithError()

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

Ah, PyFrame_GetLineNumber is now documented at Doc/c-api/reflection.rst. But 
PyFrame_New() is still not documented. So my patch is not completely useful.

@Cheryl: Maybe convert the PR without PyFrame_FastToLocals() and 
PyFrame_FastToLocalsWithError().

--

___
Python tracker 

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



[issue32258] Rewrite asyncio docs to use async/await syntax

2017-12-11 Thread Andrew Svetlov

Change by Andrew Svetlov :


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



[issue32250] Add asyncio.current_task() and asyncio.all_tasks() funcitons

2017-12-11 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

In https://github.com/python/cpython/pull/4766 discussion we decided to use 
module level functions instead of loop methods.

--
title: Add loop.current_task() and loop.all_tasks() methods -> Add 
asyncio.current_task() and asyncio.all_tasks() funcitons

___
Python tracker 

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



[issue6531] atexit_callfuncs() crashing within Py_Finalize() when using multiple interpreters.

2017-12-11 Thread Marcel Plch

Marcel Plch  added the comment:

> At a guess, the problem is because in atexit_callfuncs():
> 
>module = PyState_FindModule(&atexitmodule);
>if (module == NULL)
>return;

In #31901, I solved this problem by getiing rid of PyState_FindModule in the 
atexit code, using module state and PEP-489 multiphase initialization.

This needed some changes in the pystate and pylifecycle code, so the specific 
interpreter has a reference to its own atexit module. This way, 
Py_EndInterpreter() is able to call the callbacks for the given interpreter.

See: https://github.com/python/cpython/pull/4611

--

___
Python tracker 

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



[issue11123] problem with packaged dependency extracter script, pdeps

2017-12-11 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

This issue was resolved with the patch in #14492.

--
nosy: +csabella
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> pdeps.py has_key

___
Python tracker 

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



[issue32251] Add asyncio.BufferedProtocol

2017-12-11 Thread Yury Selivanov

Yury Selivanov  added the comment:

> See https://eklitzke.org/goroutines-nonblocking-io-and-memory-usage for an 
> interesting discussion of the drawbacks of some buffer handling idioms.

Thanks for the link!

It does make sense to use a pool of buffers for the proposed BufferedProtocol 
when you need to keep thousands of long-open connections.  The current design 
makes that easy: when BufferedProtocol.get_buffer() is called you either take a 
buffer from the pool or allocate a temporary new one.

For use-cases like DB connections (asyncpg) a permanently allocated buffer per 
protocol instance is a good solution too, as usually there's a fairly limited 
number of open DB connections.

--

___
Python tracker 

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



[issue32251] Add asyncio.BufferedProtocol

2017-12-11 Thread Yury Selivanov

Yury Selivanov  added the comment:

>> Looks nice.  Can it speed up aiohttp too?

> Yes.
> aiohttp uses own streams but public API and internal implementation are 
> pretty close to asyncio streams.
> Moreover C accelerated HTTP parser should work with proposed BufferedProtocol 
> seamlessly.

I did some benchmarks, and it looks like BufferedProtocol can make httptools up 
to 5% faster for relatively small requests < 10Kb.  Don't expect big speedups 
there.

For asyncpg, benchmarks that fetch a lot of data (50-100Kb) get faster up to 
15%.  So we'll definitely use the BufferedProtocol in asyncpg.

For applications that need to handle megabytes of data per request (like 
Antoine's benchmark) the speedup will be up to 2x.

--

___
Python tracker 

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



[issue31650] implement PEP 552

2017-12-11 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Looks fine to me now? http://buildbot.python.org/all/#/builders/21

--

___
Python tracker 

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



[issue32277] SystemError via chmod(symlink, ..., follow_symlinks=False)

2017-12-11 Thread Anthony Sottile

New submission from Anthony Sottile :

While investigating https://bugs.python.org/issue31940 I noticed the following 
is raised as `SystemError` instead of the expected `NotImplementedError`

(note: you need a platform with fchmodat but does not support nofollow)

```
touch foo
ln -s foo bar
python3.6 -c 'import os; os.chmod("bar", 0o666, follow_symlinks=False)
```

Expected: raised `NotImplementedError`
Actual: raised `SystemError`

--
messages: 308062
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: SystemError via chmod(symlink, ..., follow_symlinks=False)
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32277] SystemError via chmod(symlink, ..., follow_symlinks=False)

2017-12-11 Thread Anthony Sottile

Change by Anthony Sottile :


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

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2017-12-11 Thread Sanyam Khurana

Sanyam Khurana  added the comment:

Serhiy, can you please elaborate on that a bit? I'll try to fix this.

--

___
Python tracker 

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



[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-11 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I'm now well acquainted with with the signal and asyncio modules, but is this 
the best solution? Wouldn't be better to specify a custom handler? If this is 
possible.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29247] Document return value of epoll.poll

2017-12-11 Thread Berker Peksag

Change by Berker Peksag :


--
pull_requests: +4697

___
Python tracker 

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



[issue29247] Document return value of epoll.poll

2017-12-11 Thread Berker Peksag

Change by Berker Peksag :


--
versions:  -Python 2.7, Python 3.5

___
Python tracker 

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



[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-11 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

Serhiy: I don't know what "specify a custom handler" means in this context. Can 
you elaborate? The fd buffer overflow happens in a very delicate context where 
we definitely cannot call python code or even safely touch PyObject* variables.

--

___
Python tracker 

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



[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-11 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

A custom handler would be overkill IMO.  set_wakeup_fd() is really useful for a 
small category of library (most notably event loop frameworks).

--

___
Python tracker 

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



[issue32250] Add asyncio.current_task() and asyncio.all_tasks() funcitons

2017-12-11 Thread Andrew Svetlov

Change by Andrew Svetlov :


--
pull_requests: +4698

___
Python tracker 

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



[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-11 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I meant a callback that will be called after writing a byte to the wakeup fd is 
failed. By default it would write a warning to stderr, but the user could 
specify other callback for silencing a warning or for using other way for 
logging it. If this is impossible or overkill I have no other questions.

--

___
Python tracker 

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



[issue27645] Supporting native backup facility of SQLite

2017-12-11 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I prefer to keep Connection.backup() simpler. Additional features can be 
implemented in pure Python.

--

___
Python tracker 

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



[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

As I wrote, I never saw this warning, even while debugging signal issues in
asyncio on FreeBSD. I don't think that this is an use case for a callback.
Nathaniel use case is just to ignore the warning, I consider that it's a
reasonable compromise for the issue.

If someone wants a more advanced signal handler, it's still possible to use
register a custom signal handler at the C level.

--

___
Python tracker 

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



[issue32277] SystemError via chmod(symlink, ..., follow_symlinks=False)

2017-12-11 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Does any existing test failed on such platform?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32277] SystemError via chmod(symlink, ..., follow_symlinks=False)

2017-12-11 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
components: +Extension Modules
type:  -> behavior
versions:  -Python 3.8

___
Python tracker 

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



[issue32278] Allow dataclasses.make_dataclass() to omit type information

2017-12-11 Thread Eric V. Smith

New submission from Eric V. Smith :

Make the typing information optional.

>From Raymond Hettinger:

The make_dataclass() factory function in the dataclasses module currently 
requires type declarations. It would be nice if the type declarations were 
optional.

With typing (currently works):

Point = NamedTuple('Point', [('x', float), ('y', float), ('z', float)])
Point = make_dataclass('Point', [('x', float), ('y', float), ('z', float)])

Without typing (only the first currently works):

Point = namedtuple('Point', ['x', 'y', 'z'])  # underlying store is 
a tuple
Point = make_dataclass('Point', ['x', 'y', 'z'])  # underlying store is 
an instance dict

--
assignee: eric.smith
components: Library (Lib)
messages: 308071
nosy: eric.smith, levkivskyi, rhettinger
priority: normal
severity: normal
status: open
title: Allow dataclasses.make_dataclass() to omit type information
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



[issue32277] SystemError via chmod(symlink, ..., follow_symlinks=False)

2017-12-11 Thread Anthony Sottile

Anthony Sottile  added the comment:

I noticed it when I changed the test preconditions in 
https://github.com/python/cpython/pull/4783

I tried changing a test to trigger this (in this branch) but I found I was just 
implementing exactly the test in the `skip` condition which to me didn't feel 
like a very valuable test.

>From what I can tell, the current testsuite passes on my machine before and 
>after this change -- only with the small reproduction.

--

___
Python tracker 

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



[issue31643] test_uuid: test_getnode and test_windll_getnode fail if connected to the Internet via an Android phone

2017-12-11 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +barry, serhiy.storchaka, xdegaye

___
Python tracker 

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



[issue29137] Fix fpectl-induced ABI breakage

2017-12-11 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +rhettinger, stutzbach, twouters

___
Python tracker 

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



[issue27645] Supporting native backup facility of SQLite

2017-12-11 Thread Lele Gaifax

Lele Gaifax  added the comment:

Thank you Serhiy, ok: will simplify the method, hopefully tomorrow.

--

___
Python tracker 

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



[issue32279] Pass keyword arguments from dataclasses.make_dataclass() to @dataclass.

2017-12-11 Thread Eric V. Smith

New submission from Eric V. Smith :

make_dataclass() should take optional keyword only arguments and pass them to 
@dataclass() when it uses it after it creates a new class.

The parameters are:
init=True, repr=True, eq=True, order=False, hash=None, frozen=False

Obviously, these should reflect their default values in @dataclass, should that 
ever change.

--
assignee: eric.smith
components: Library (Lib)
messages: 308074
nosy: eric.smith, levkivskyi, rhettinger
priority: normal
severity: normal
status: open
title: Pass keyword arguments from dataclasses.make_dataclass() to @dataclass.
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



[issue29620] unittest.TestCase.assertWarns raises RuntimeEror if sys.modules changes size

2017-12-11 Thread kernc

Change by kernc :


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

___
Python tracker 

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



[issue32227] singledispatch support for type annotations

2017-12-11 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset e56975351bc2c574c728f738e88effba7116279f by Łukasz Langa in 
branch 'master':
bpo-32227: functools.singledispatch supports registering via type annotations 
(#4733)
https://github.com/python/cpython/commit/e56975351bc2c574c728f738e88effba7116279f


--

___
Python tracker 

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



[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-11 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This can affect Cython which uses the "fast call" convention.

--
nosy: +scoder

___
Python tracker 

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



[issue19431] Document PyFrame_FastToLocals() and PyFrame_FastToLocalsWithError()

2017-12-11 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Thanks Victor and Serhiy.

>> @Cheryl: Maybe convert the PR without PyFrame_FastToLocals() and 
>> PyFrame_FastToLocalsWithError().

If I only convert PyFrame_New() then I would need to add it to as existing page 
since the patch created a new page for Frame Objects.  I think the right place 
would be under the current PyFrameObject in Doc/c-api/veryhigh.rst?

Thanks!

--

___
Python tracker 

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



[issue32280] Expose `_PyRuntime` through a section name

2017-12-11 Thread Maxime Belanger

New submission from Maxime Belanger :

We've recently been toying with more sophisticated crash reporting machinery 
for our Desktop Python application (which we deploy on macOS, Windows and 
Linux).

To assist in debugging, we are storing `_PyRuntime` in a predictable location 
our crash reporter can later look up without needing the symbol table (this can 
grow complicated across multiple platforms).

Taking a page from `crashpad`'s book 
(https://chromium.googlesource.com/crashpad/crashpad/+/master/client/crashpad_info.cc),
 we've patched `pylifecycle.c` to store the `_PyRuntime` struct in a section of 
the same name. Upon a crash,  this section is then used by the tool to annotate 
each report with enough information to reconstruct the Python stack frames in 
each thread (as applicable).

We're contributing our patch here in the hopes this can be helpful to others.

--
components: Interpreter Core, Windows, macOS
messages: 308079
nosy: Maxime Belanger, ned.deily, paul.moore, ronaldoussoren, steve.dower, 
tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Expose `_PyRuntime` through a section name
type: enhancement
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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-12-11 Thread Lior Cohen

Lior Cohen  added the comment:

Joining @Serhiy Storchaka last question.
Is the __get__ method existance is a must be a data descriptor?

According to the C implementation in descrobject.h
```
#define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL)
#endif
```
the answer is No.
Does this C code reflect the true definition?

--
nosy: +chnlior

___
Python tracker 

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



[issue32281] bdist_rpm v.s. the Macintosh

2017-12-11 Thread Ben Hyde

New submission from Ben Hyde :

With the fix below is becomes possible to build rpms on the Mac.

The developer will need to install rpm tooling.  That's easy via "brew install 
rpm".

That, for example, installs /usr/local/bin/rpmbuild.

Sadly bdist_rpm.py only supports rpmbuild in two places, see:

https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Lib/distutils/command/bdist_rpm.py#L313

Which due to the Mac's fastidious security setup we are very strongly 
discouraged from working around.

So, yeah, let's add a third, like so maybe:

if ((os.path.exists('/usr/bin/rpmbuild')
 or os.path.exists('/bin/rpmbuild')
 or os.path.exists('/usr/local/bin/rpmbuild'))):
rpm_cmd = ['rpmbuild']

And now I can use build_rpm on my mac, oh joy.

--
components: Distutils
messages: 308080
nosy: bhyde, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: bdist_rpm v.s. the Macintosh
type: enhancement
versions: Python 2.7

___
Python tracker 

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



[issue32280] Expose `_PyRuntime` through a section name

2017-12-11 Thread Steve Dower

Change by Steve Dower :


--
nosy: +eric.snow

___
Python tracker 

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



[issue32280] Expose `_PyRuntime` through a section name

2017-12-11 Thread Steve Dower

Change by Steve Dower :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue32280] Expose `_PyRuntime` through a section name

2017-12-11 Thread Max Bélanger

Change by Max Bélanger :


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

___
Python tracker 

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



[issue31643] test_uuid: test_getnode and test_windll_getnode fail if connected to the Internet via an Android phone

2017-12-11 Thread Ivan Pozdeev

Change by Ivan Pozdeev :


--
pull_requests: +4701

___
Python tracker 

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



[issue32282] When using a Windows XP compatible toolset, `socketmodule.c` fails to build

2017-12-11 Thread Maxime Belanger

New submission from Maxime Belanger :

If Python is built using the Windows XP "variant" of the toolset (e.g. 
`v140_xp`), build errors can occur in `socketmodule.c`. This is due to the 
include of `VersionHelpers.h` being gated on `_MSC_VER`, which "lies" if 
`v140_xp` is in use.

We'll be contributing our patch to this issue here.

--
components: Windows
messages: 308081
nosy: Maxime Belanger, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: When using a Windows XP compatible toolset, `socketmodule.c` fails to 
build
versions: Python 3.5, 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



[issue32282] When using a Windows XP compatible toolset, `socketmodule.c` fails to build

2017-12-11 Thread Max Bélanger

Change by Max Bélanger :


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

___
Python tracker 

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



[issue32283] Cmd.onecmd documentation is misleading

2017-12-11 Thread Kevin Lyda

New submission from Kevin Lyda :

The documentation for Cmd.onecmd is misleading. It says that "This may be 
overridden, but should not normally need to be; see the precmd() and postcmd() 
methods for useful execution hooks."

https://github.com/python/cpython/blob/v3.7.0a3/Lib/cmd.py#L193

However a common idiom is to call onecmd directly to process commands coming 
from sys.argv. This shows up in the Cmd entries the Python MOTW site for 
instance.

https://pymotw.com/3/cmd/#commands-from-sys-argv

>From the docs you might think that precmd and postcmd are called when you call 
>onecmd directly this way. However this is not true - they are only called in 
>the cmdloop method.

https://github.com/python/cpython/blob/v3.7.0a3/Lib/cmd.py#L137

Moving the precmd and postcmd methods into onecmd would make the onecmd docs 
make more sense. Then they could be used in lieu of overriding onecmd for all 
uses of onecmd - inside of cmdloop and on its own. But loads of code depends on 
current behaviour.

So instead something in the docs to indicate that those hooks only work when 
onecmd is called inside cmdloop would be good. Perhaps like so:

"""Interpret the argument as though it had been typed in response
to the prompt.

This may be overridden, but should not normally need to be;
see the precmd() and postcmd() methods for useful execution hooks
when onecmd() is called from cmdloop(). When onecmd() is called
directly, make sure to call precmd() and postcmd() yourself.
The return value is a flag indicating whether interpretation of
commands by the interpreter should stop.

"""

--
components: Library (Lib)
messages: 308082
nosy: lyda
priority: normal
severity: normal
status: open
title: Cmd.onecmd documentation is misleading
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



[issue32284] typing.TextIO and BinaryIO are not aliases of IO[...]

2017-12-11 Thread Sebastian Rittau

New submission from Sebastian Rittau :

See https://github.com/python/typing/issues/518 for context.

The typing documentation for 3.6.4rc1 states:

> typing.io ... defines the generic type IO[AnyStr] and aliases TextIO and 
> BinaryIO for respectively IO[str] and IO[bytes].

In the current implementation TextIO and BinaryIO are not aliases, but instead 
derived from IO. This means that values of type IO[...], and especially IO[Any] 
can not be assigned where TextIO or BinaryIO is expected.

--
assignee: docs@python
components: Documentation
messages: 308083
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: typing.TextIO and BinaryIO are not aliases of IO[...]
versions: Python 3.6

___
Python tracker 

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



[issue29970] Severe open file leakage running asyncio SSL server

2017-12-11 Thread kyuupichan

kyuupichan  added the comment:

I'm not sure what you mean about this being a server-specific problem.  It's 
clearly a bug in the asyncio SSL wrapper as using TCP instead of SSL with 
otherwise identical code doesn't leak open files.

--

___
Python tracker 

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



[issue32285] In `unicodedata`, it should be possible to check a unistr's normal form without necessarily copying it

2017-12-11 Thread Maxime Belanger

New submission from Maxime Belanger :

In our deployment of Python 2.7, we've patched `unicodedata` to introduce a new 
function: `is_normalized` can check whether a unistr is in a given normal form. 
This currently has to be done by creating a normalized copy, then checking 
whether it is equal to the source string.

This function uses the internal helper (also called `is_normalized`) that can 
"quick check" normalization, but falls back on creating a normalized copy and 
comparing (when necessary).

We're contributing this change in case this can helpful to others. Feedback is 
welcome!

--
components: Unicode
messages: 308085
nosy: Maxime Belanger, ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: In `unicodedata`, it should be possible to check a unistr's normal form 
without necessarily copying it
versions: Python 2.7, Python 3.7

___
Python tracker 

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



[issue32285] In `unicodedata`, it should be possible to check a unistr's normal form without necessarily copying it

2017-12-11 Thread Max Bélanger

Change by Max Bélanger :


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

___
Python tracker 

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



[issue26256] Fast decimalisation and conversion to other bases

2017-12-11 Thread Cheryl Sabella

Change by Cheryl Sabella :


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

___
Python tracker 

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



[issue26256] Fast decimalisation and conversion to other bases

2017-12-11 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue17013] Allow waiting on a mock

2017-12-11 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
stage:  -> needs patch
versions: +Python 3.8 -Python 3.4

___
Python tracker 

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



[issue18533] Avoid error from repr() of recursive dictview

2017-12-11 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Ben, would you be interested in making a Github pull request against the 
current master for your patch?  It appears there was interest in moving forward 
with this and it is still occurring on 3.7, although it now raises a 
RecursionError.

>>> d = {}
>>> d[1] = d.keys()
>>> d
{1: dict_keys([1])}
>>> d[2] = d.values()
>>> d
Traceback (most recent call last):
  File "", line 1, in 
RecursionError: maximum recursion depth exceeded while getting the repr of an 
object

--
nosy: +csabella

___
Python tracker 

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



[issue31643] test_uuid: test_getnode and test_windll_getnode fail if connected to the Internet via an Android phone

2017-12-11 Thread Ivan Pozdeev

Change by Ivan Pozdeev :


Removed file: 
https://bugs.python.org/file47178/0001-Allow-for-all-zero-MAC-based-node-ID-e.g.-mobile-mod.patch

___
Python tracker 

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



  1   2   >