[issue36974] Implement PEP 590

2019-05-21 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


--
pull_requests: +13397

___
Python tracker 

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



[issue36995] tp_print -> tp_vectorcall_offset

2019-05-21 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

I see what you mean now. One bpo issue with many pull requests. I was following 
the CPython policy that every pull request needed an issue, but it didn't occur 
to me to put multiple independent PRs on one issue.

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



[issue34616] implement "Async exec"

2019-05-21 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

> section to document the new flag inside "Improved Modules" category

Done in https://github.com/python/cpython/pull/13484

--

___
Python tracker 

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



[issue34616] implement "Async exec"

2019-05-21 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


--
pull_requests: +13396

___
Python tracker 

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



Re: CPython compiled failed in macOS

2019-05-21 Thread Inada Naoki
You may need to clean your source tree.  "make distclean" or "git clean -fx".

2019年5月22日(水) 13:34 Windson Yang :
>
> version: macOS 10.14.4, Apple LLVM version 10.0.1 (clang-1001.0.46.4).
>
> I cloned the CPython source code from GitHub then compiled it which used to
> work quite well. However, I messed up my terminal a few days ago for
> installing gdb. Now when I try to compile the latest CPython source code
> with ./configure --with-pydebug && make -j I always get the error messages:
>
> ld: warning: ld: warning: ignoring file libpython3.8d.a, file was
> built for archive which is not the architecture being linked (x86_64):
> libpython3.8d.aignoring file libpython3.8d.a, file was built for
> archive which is not the architecture being linked (x86_64):
> libpython3.8d.a
> Undefined symbols for architecture x86_64:
>   "__Py_UnixMain", referenced from:
>   _main in python.o
> ld: symbol(s) not found for architecture x86_64Undefined symbols for
> architecture x86_64:
>   "_PyEval_InitThreads", referenced from:
>   _test_repeated_init_and_subinterpreters in _testembed.o
>   "_PyEval_ReleaseThread", referenced from:
>   _test_repeated_init_and_subinterpreters in _testembed.o
>   "_PyEval_RestoreThread", referenced from:
>   _test_repeated_init_and_subinterpreters in _testembed.o
>   _test_bpo20891 in _testembed.o
>   "_PyEval_SaveThread", referenced from:
>   _test_bpo20891 in _testembed.o
>   "_PyGILState_Check", referenced from:
>   _bpo20891_thread in _testembed.o
>   "_PyGILState_Ensure", referenced from:
>   _test_repeated_init_and_subinterpreters in _testembed.o
>   _bpo20891_thread in _testembed.o
>   "_PyGILState_Release", referenced from:
>   _test_repeated_init_and_subinterpreters in _testembed.o
>   _bpo20891_thread in _testembed.o
>   "_PyInterpreterState_GetID", referenced from:
>   _print_subinterp in _testembed.o
>   "_PyMem_RawFree", referenced from:
>   _test_pre_initialization_api in _testembed.o
>   "_PyRun_SimpleStringFlags", referenced from:
>   _test_pre_initialization_api in _testembed.o
>   _test_pre_initialization_sys_options in _testembed.o
>   _test_init_main in _testembed.o
>   _check_stdio_details in _testembed.o
>   _print_subinterp in _testembed.o
>   _dump_config in _testembed.o
>   "_PySys_AddWarnOption", referenced from:
>   _test_pre_initialization_sys_options in _testembed.o
>   "_PySys_AddXOption", referenced from:
>   _test_pre_initialization_sys_options in _testembed.o
>   "_PySys_ResetWarnOptions", referenced from:
>   _test_pre_initialization_sys_options in _testembed.o
>   "_PyThreadState_Get", referenced from:
>   _test_repeated_init_and_subinterpreters in _testembed.o
>   _print_subinterp in _testembed.o
>   "_PyThreadState_Swap", referenced from:
>   _test_repeated_init_and_subinterpreters in _testembed.o
>   "_PyThread_acquire_lock", referenced from:
>   _test_bpo20891 in _testembed.o
>   "_PyThread_allocate_lock", referenced from:
>   _test_bpo20891 in _testembed.o
>   "_PyThread_exit_thread", referenced from:
>   _bpo20891_thread in _testembed.o
>   "_PyThread_free_lock", referenced from:
>   _test_bpo20891 in _testembed.o
>   "_PyThread_release_lock", referenced from:
>   _bpo20891_thread in _testembed.o
>   "_PyThread_start_new_thread", referenced from:
>   _test_bpo20891 in _testembed.o
>   "_Py_BytesWarningFlag", referenced from:
>   _test_init_global_config in _testembed.o
>   _test_init_from_config in _testembed.o
>   _set_all_global_config_variables in _testembed.o
>   "_Py_DebugFlag", referenced from:
>   _set_all_global_config_variables in _testembed.o
>   "_Py_DecodeLocale", referenced from:
>   _test_pre_initialization_api in _testembed.o
>   "_Py_DontWriteBytecodeFlag", referenced from:
>   _test_init_global_config in _testembed.o
>   _test_init_from_config in _testembed.o
>   _set_all_global_config_variables in _testembed.o
>   _check_init_python_config in _testembed.o
>   "_Py_EndInterpreter", referenced from:
>   _test_repeated_init_and_subinterpreters in _testembed.o
>   "_Py_Finalize", referenced from:
>   _test_forced_io_encoding in _testembed.o
>   _test_repeated_init_and_subinterpreters in _testembed.o
>   _test_pre_initialization_api in _testembed.o
>   _test_pre_initialization_sys_options in _testembed.o
>   _test_initialize_twice in _testembed.o
>   _test_initialize_pymain in _testembed.o
>   _test_init_default_config in _testembed.o
>   ...
>   "_Py_FrozenFlag", referenced from:
>   _test_init_global_config in _testembed.o
>   _test_init_from_config in _testembed.o
>   _set_all_global_config_variables in _testembed.o
>   _check_init_python_config in _testembed.o
>   "_Py_IgnoreEnvironmentFlag", referenced from:
>   _test_init_env in _testembed.o
>   _test_init_env_dev_mode in _testembed.o
>   

[issue37003] ast unparse does not support f-string new debug format.

2019-05-21 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Just for clarification for future readers;

I landed a PR that used f"{x=}" in some new functionalities, and that broke the 
buildbots, the buildbots do test that many of the `Lib/` files can be 
round-tripped ast->unparse->ast, and as ast-unparse did not understood f-debug, 
if roundtripped f"{x=}" to f"{x!r}". The PRs CIs did not fail as apparently 
they don't test this functionality.

So currently not having support for f-string-debug in ast-unparse kind of 
prevent using f-string debug format in the stdlib.

I'm happy if `expr_text` get removed, and having unparse round-trip to 
`x={x!r}` sounds sufficient to me; it may make like of formatters like black a 
bit harder maybe ? Though I believe black is likely not using ast but lib2to3.

--

___
Python tracker 

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



CPython compiled failed in macOS

2019-05-21 Thread Windson Yang
version: macOS 10.14.4, Apple LLVM version 10.0.1 (clang-1001.0.46.4).

I cloned the CPython source code from GitHub then compiled it which used to
work quite well. However, I messed up my terminal a few days ago for
installing gdb. Now when I try to compile the latest CPython source code
with ./configure --with-pydebug && make -j I always get the error messages:

ld: warning: ld: warning: ignoring file libpython3.8d.a, file was
built for archive which is not the architecture being linked (x86_64):
libpython3.8d.aignoring file libpython3.8d.a, file was built for
archive which is not the architecture being linked (x86_64):
libpython3.8d.a
Undefined symbols for architecture x86_64:
  "__Py_UnixMain", referenced from:
  _main in python.o
ld: symbol(s) not found for architecture x86_64Undefined symbols for
architecture x86_64:
  "_PyEval_InitThreads", referenced from:
  _test_repeated_init_and_subinterpreters in _testembed.o
  "_PyEval_ReleaseThread", referenced from:
  _test_repeated_init_and_subinterpreters in _testembed.o
  "_PyEval_RestoreThread", referenced from:
  _test_repeated_init_and_subinterpreters in _testembed.o
  _test_bpo20891 in _testembed.o
  "_PyEval_SaveThread", referenced from:
  _test_bpo20891 in _testembed.o
  "_PyGILState_Check", referenced from:
  _bpo20891_thread in _testembed.o
  "_PyGILState_Ensure", referenced from:
  _test_repeated_init_and_subinterpreters in _testembed.o
  _bpo20891_thread in _testembed.o
  "_PyGILState_Release", referenced from:
  _test_repeated_init_and_subinterpreters in _testembed.o
  _bpo20891_thread in _testembed.o
  "_PyInterpreterState_GetID", referenced from:
  _print_subinterp in _testembed.o
  "_PyMem_RawFree", referenced from:
  _test_pre_initialization_api in _testembed.o
  "_PyRun_SimpleStringFlags", referenced from:
  _test_pre_initialization_api in _testembed.o
  _test_pre_initialization_sys_options in _testembed.o
  _test_init_main in _testembed.o
  _check_stdio_details in _testembed.o
  _print_subinterp in _testembed.o
  _dump_config in _testembed.o
  "_PySys_AddWarnOption", referenced from:
  _test_pre_initialization_sys_options in _testembed.o
  "_PySys_AddXOption", referenced from:
  _test_pre_initialization_sys_options in _testembed.o
  "_PySys_ResetWarnOptions", referenced from:
  _test_pre_initialization_sys_options in _testembed.o
  "_PyThreadState_Get", referenced from:
  _test_repeated_init_and_subinterpreters in _testembed.o
  _print_subinterp in _testembed.o
  "_PyThreadState_Swap", referenced from:
  _test_repeated_init_and_subinterpreters in _testembed.o
  "_PyThread_acquire_lock", referenced from:
  _test_bpo20891 in _testembed.o
  "_PyThread_allocate_lock", referenced from:
  _test_bpo20891 in _testembed.o
  "_PyThread_exit_thread", referenced from:
  _bpo20891_thread in _testembed.o
  "_PyThread_free_lock", referenced from:
  _test_bpo20891 in _testembed.o
  "_PyThread_release_lock", referenced from:
  _bpo20891_thread in _testembed.o
  "_PyThread_start_new_thread", referenced from:
  _test_bpo20891 in _testembed.o
  "_Py_BytesWarningFlag", referenced from:
  _test_init_global_config in _testembed.o
  _test_init_from_config in _testembed.o
  _set_all_global_config_variables in _testembed.o
  "_Py_DebugFlag", referenced from:
  _set_all_global_config_variables in _testembed.o
  "_Py_DecodeLocale", referenced from:
  _test_pre_initialization_api in _testembed.o
  "_Py_DontWriteBytecodeFlag", referenced from:
  _test_init_global_config in _testembed.o
  _test_init_from_config in _testembed.o
  _set_all_global_config_variables in _testembed.o
  _check_init_python_config in _testembed.o
  "_Py_EndInterpreter", referenced from:
  _test_repeated_init_and_subinterpreters in _testembed.o
  "_Py_Finalize", referenced from:
  _test_forced_io_encoding in _testembed.o
  _test_repeated_init_and_subinterpreters in _testembed.o
  _test_pre_initialization_api in _testembed.o
  _test_pre_initialization_sys_options in _testembed.o
  _test_initialize_twice in _testembed.o
  _test_initialize_pymain in _testembed.o
  _test_init_default_config in _testembed.o
  ...
  "_Py_FrozenFlag", referenced from:
  _test_init_global_config in _testembed.o
  _test_init_from_config in _testembed.o
  _set_all_global_config_variables in _testembed.o
  _check_init_python_config in _testembed.o
  "_Py_IgnoreEnvironmentFlag", referenced from:
  _test_init_env in _testembed.o
  _test_init_env_dev_mode in _testembed.o
  _test_init_env_dev_mode_alloc in _testembed.o
  _set_all_global_config_variables in _testembed.o
  _check_init_python_config in _testembed.o
  "_Py_Initialize", referenced from:
  _test_forced_io_encoding in _testembed.o
  _test_pre_initialization_api in _testembed.o
  _test_initialize_twice in _testembed.o
  

[issue36997] Document that spwd is considered harmful

2019-05-21 Thread Arfrever Frehtes Taifersar Arahesis


Arfrever Frehtes Taifersar Arahesis  added the comment:

> On BSD, Linux, and macOS, account and credential verification must go through 
> PAM.

At least the part about Linux is not entirely true.
If PAM is installed and used, then account and credential verification should 
probably go through PAM, but system administrator is free to decide to not 
install PAM at all.

Perhaps some Linux distributions like Red Hat and Fedora do not support 
PAM-free systems, but Gentoo certainly supports PAM-free systems (support for 
PAM is enabled by default in Gentoo, but is not enforced).

--
nosy: +Arfrever

___
Python tracker 

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



[issue37001] symtable.symtable doesn't accept bytes which leads to a mismatch from compile()

2019-05-21 Thread Dino Viehland


Change by Dino Viehland :


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

___
Python tracker 

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



[issue37005] bz2 module doesn't write end-of-stream marker

2019-05-21 Thread Dobatymo


New submission from Dobatymo :

According to https://en.wikipedia.org/wiki/Bzip2 the reference implementation 
of bzip2 writes an end-of-stream marker (also called stream footer) with a 
magic number and a stream checksum to the file.

Python does not do so. The files can still be read by all bzip2 compatible 
software I tried. For completeness and better error detection however, writing 
this marker (optionally maybe) would be useful.

--
messages: 343143
nosy: Dobatymo
priority: normal
severity: normal
status: open
title: bz2 module doesn't write end-of-stream marker
type: behavior
versions: Python 2.7, Python 3.5, 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



[issue36981] asyncio transport.write() memory out

2019-05-21 Thread viocal


viocal  added the comment:

I have fixed it
modified selector_events.py

def write(self, data):
if not isinstance(data, (bytes, bytearray, memoryview)):
raise TypeError(f'data argument must be a bytes-like object, '
f'not {type(data).__name__!r}')
 ...
if not self._buffer:
# Optimization: try to send now.
while True: #add by viocal
try:
n = self._sock.send(data)
except (BlockingIOError, InterruptedError):
pass
except Exception as exc:
self._fatal_error(exc, 'Fatal write error on socket 
transport')
return
else:
data = data[n:]
if not data:
return
# Not all was written; register write handler.
if not data
self._loop._add_writer(self._sock_fd, self._write_ready)

# Add it to the buffer.
self._buffer.extend(data)
self._maybe_pause_protocol()

--
status: open -> pending

___
Python tracker 

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



[issue36981] asyncio transport.write() memory out

2019-05-21 Thread viocal


viocal  added the comment:

I have fixed it
modified selector_events.py

def write(self, data):
if not isinstance(data, (bytes, bytearray, memoryview)):
raise TypeError(f'data argument must be a bytes-like object, '
f'not {type(data).__name__!r}')
 ...
if not self._buffer:
# Optimization: try to send now.
while True: #add by viocal
try:
n = self._sock.send(data)
except (BlockingIOError, InterruptedError):
pass
except Exception as exc:
self._fatal_error(exc, 'Fatal write error on socket 
transport')
return
else:
data = data[n:]
if not data:
return
# Not all was written; register write handler.
self._loop._add_writer(self._sock_fd, self._write_ready)

# Add it to the buffer.
self._buffer.extend(data)
self._maybe_pause_protocol()

--
resolution:  -> fixed

___
Python tracker 

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



[issue36988] zipfile: string IndexError on extract

2019-05-21 Thread KunYu Chen


KunYu Chen  added the comment:

Hi alter-bug-tracer,

We notice about this pitfall when extracting zipbomb files.
and we have discussion here

https://bugs.python.org/issue36260

--
nosy: +18z

___
Python tracker 

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



[issue37004] SequenceMatcher.ratio() noncommutativity not well-documented

2019-05-21 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue36948] NameError in urllib.request.URLopener.retrieve

2019-05-21 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thank you David and Berker.

--

___
Python tracker 

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



[issue37004] SequenceMatcher.ratio() noncommutativity not well-documented

2019-05-21 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +tim.peters

___
Python tracker 

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



[issue36997] Document that spwd is considered harmful

2019-05-21 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



[issue37004] SequenceMatcher.ratio() noncommutativity not well-documented

2019-05-21 Thread Dennis Sweeney


New submission from Dennis Sweeney :

I understand that the SequenceMatcher's ratio method does not guarantee that 
SequenceMatcher(None, a, b).ratio() == SequenceMatcher(None, b, a).ratio(). 
Below is a counterexample:

# Example from 
https://mail.python.org/pipermail/python-list/2010-November/593063.html
>>> SequenceMatcher(None, 'BRADY', 'BYRD').ratio()
0.
>>> SequenceMatcher(None, 'BYRD', 'BRADY').ratio()
0.

I was recently solving a problem that required a textual similarity ratio 
function and I wrongly assumed that SequenceMatcher treated both input strings 
symmetrically, which was an extremely difficult bug to find, especially because 
for many simple tests, the ratio IS symmetric:

>>> SequenceMatcher(None, 'apple', 'banana').ratio()
0.18181818181818182
>>> SequenceMatcher(None, 'banana', 'apple').ratio()
0.18181818181818182

I would like to see a clearer warning of this asymmetry in the documentation 
for the difflib module. Perhaps something like

  .. note::

 Caution: The result of a :meth:`ratio` call is *NOT* symmetric with 
 respect to the order of the arguments. For instance::

>>> SequenceMatcher(None, 'brady', 'byrd').ratio()
0.
>>> SequenceMatcher(None, 'byrd', 'brady').ratio()
0.

Without such a note near the ratio methods' documentations, it is far too easy 
to google for a Python stdlib functionality for computing text similarity, skip 
straight to the ratio method, look at the examples given, try some of your own 
simple examples, and accidentally convince oneself that this symmetry exists.

--
messages: 343138
nosy: Dennis Sweeney, docs@python
priority: normal
severity: normal
status: open
title: SequenceMatcher.ratio() noncommutativity not well-documented

___
Python tracker 

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



Re: What does at 0x0402C7B0> mean?

2019-05-21 Thread Cameron Simpson

On 21May2019 18:11, CrazyVideoGamez  wrote:

I tried doing a list comprehension. I typed:

favorite_fruits = ['watermelon', 'blackberries']
print(fruit for fruit in favorite_fruits)

And I got:

 at 0x0402C7B0>

What does this mean and what do I have to fix?


It means you didn't make a list comprehension. You've discovered a 
similar thing though.


A list comprehension includes square brackets:

 [ fruit for fruit in favorite_fruits ]

The result of that expression is literally a list, in this case 
effectively a copy of your favorite_fruits list.


However, what you wrote was this:

 fruit for fruit in favorite_fruits

and that is a generator expression. It is effectively an object that you 
can iterate over, and it will yield the elements from favourite_fruits.


Importantly, it doesn't construct a list. It constructs a tiny function.

Why might we want such a thing? Because it is "lazy": it only computes 
values which are actually asked for (consumed). The list comprehension 
computes all the values, _and_ allocates a list and stores them! This 
consumes more memory (except for small lists) and stalls your programme 
while that work takes place.


It is equivalent to this function:

 def elements_of(some_list):
   for element in some_list:
 yield element

That is a "generator function", and when you call it eg 
"elements_of(favorite_fruits)" it doesn't run. Instead it returns you a 
generator object which is effectively a call to the function frozen in 
time.


The generator object is iterable, and when you iterate over it if fires 
up the frozen function. The function runs until it hits a yield 
statement, where it yields a value and that is the next value for the 
iteration; the function freezes again then.


Consider this loop:

 stop_at = 'watermelon'
 for value in [ fruit for fruit in favorite_fruits ]:
   print(value)
   if value == stop_at:
 break

This (a) constructs a list containing all the elements of 
favorite_fruits then (b) iterates over the elements of that list. When 
it hits a particular one of those elements it exits the loop.


If we unfold the "for" line a little:

 elements = [ fruit for fruit in favorite_fruits ]
 for value in elements:

The same amount of work is done, it just makes clear that the list 
construction is a whole distinct step.


Now compare (generator expression in brackets, for clarity.:

 stop_at = 'watermelon'
 elements = fruit for fruit in favorite_fruits
 for value in elements:
   print(value)
   if value == stop_at:
 break

Now "elements" is not a list, it is a generator expression. You can 
still iterate over this, and the printed output will be the same.  
However, before the "for", _no_ elements of favorite_fruits have been 
iterated over - almost no work has happened at all. Then as the for loop 
iterates, it fetches values from "elements", which yields them as 
needed.


So that when the loop stops early, no effort (or memory storage) is 
wasted looking at the tail of the list.


Your list is very small, but for large lists this is a significant win.  
Some lists are (notionally) infinitely large.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: What does at 0x0402C7B0> mean?

2019-05-21 Thread Terry Reedy

On 5/21/2019 9:11 PM, CrazyVideoGamez wrote:

I tried doing a list comprehension. I typed:

favorite_fruits = ['watermelon', 'blackberries']
print(fruit for fruit in favorite_fruits)

And I got:
 at 0x0402C7B0>
What does this mean


It means that the expression (fruit for fruit in favorite_fruits) 
evaluates to a generator object.



and what do I have to fix?


Perhaps you wanted to run the generator, perhaps like this:

>>> favorite_fruits = ['watermelon', 'blackberries']
>>> print(*(fruit for fruit in favorite_fruits))
watermelon blackberries

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


[issue36799] Typo in ctypes documentation

2019-05-21 Thread Paul Monson


Change by Paul Monson :


--
pull_requests: +13393

___
Python tracker 

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



Re: What does at 0x0402C7B0> mean?

2019-05-21 Thread Chris Angelico
On Wed, May 22, 2019 at 11:16 AM CrazyVideoGamez
 wrote:
>
> I tried doing a list comprehension. I typed:
>
> favorite_fruits = ['watermelon', 'blackberries']
> print(fruit for fruit in favorite_fruits)
>
> And I got:
>
>  at 0x0402C7B0>
>
> What does this mean and what do I have to fix?

It means that you just printed out a generator object. But to "fix"
this, you first have to explain what you wanted.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


What does at 0x0402C7B0> mean?

2019-05-21 Thread CrazyVideoGamez
I tried doing a list comprehension. I typed:

favorite_fruits = ['watermelon', 'blackberries']
print(fruit for fruit in favorite_fruits)

And I got:

 at 0x0402C7B0> 

What does this mean and what do I have to fix?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30790] Can't use proxy to connect internet on windows

2019-05-21 Thread Cheryl Sabella


New submission from Cheryl Sabella :

Please provide an example showing a scenario where this change would be needed. 
 Also, a test case needs to be added to the pull request that would fail 
without the change and pass with the change.  Thanks!

--
nosy: +cheryl.sabella
resolution: wont fix -> 
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue36763] Implementation of the PEP 587

2019-05-21 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13392

___
Python tracker 

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



[issue36981] asyncio transport.write() memory out

2019-05-21 Thread viocal


viocal  added the comment:

thanks again
the environment:
filedata1<512M
filedata2>512M
filedata3>1G
this computer-peer computer
server(with asyncio)--clien(socket without asyncio)
memory<512M---memory>512M
read filedata1 <- success
read filedata2 <- success
read filedata3 <- success
write filedata1 -> success
write filedata2 -> fail
write filedata2 -> fail

how todo  (function set_write_buffer_limits) is work

--

___
Python tracker 

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



[issue36998] distutils sdist command fails to create MANIFEST if any filenames are undecodable

2019-05-21 Thread Toshio Kuratomi


Toshio Kuratomi  added the comment:

Figured out the answer to my last question while looking into fixing it.  The 
devguide documents both running tests via regrtest and running them via 
unittest test discovery.  regrtest works:

  ./python -m test -v distutils.test

But unittest doesn't:
  ./python -m unittest -v test.test_distutils
  ./python -m unittest -v distutils.test.test_file_utils
  # etc

I'll submit a separate PR to get that working.

--

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-05-21 Thread STINNER Victor


STINNER Victor  added the comment:

> It seems to me that we don't need to have the PyObject structure containing a 
> Python float to be 16-byte aligned.  If so, could we introduce a new obmalloc 
> API that returns memory with 8-byte alignment, for use by objects that know 
> they don't require 16-byte alignment?  floatobject.c could use this API to 
> avoid the 33% overhead.

PyMem_Malloc / PyObject_Malloc only have one parameter: "size". It knows 
nothing about the allocated structure.

bpo-18835 discussed the idea of adding a new API which accept an alignment 
parameter. The issue was closed because of the lack of concrete usage.

In the clang crash bpo-36618 (which decided us to fix this issue), C alignof() 
function was discussed:
https://bugs.python.org/issue36618#msg340279

Copy of serge-sans-paille's comment:

"@vstinner: once you have a portable version of alignof, you can deciding to 
*not* use the pool allocator if the required alignment is greater than 8B, or 
you could modify the pool allocator to take alignment information as an extra 
parameter?"

--

___
Python tracker 

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



[issue36998] distutils sdist command fails to create MANIFEST if any filenames are undecodable

2019-05-21 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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-05-21 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

> sys.getsizeof(3.14) is 24.  And it becomes 32 byte in 16byte aligned 
> pymalloc. (+33%)

I've been doing some reading and trying to understand this issue.  My 
understanding is that malloc() needs to return pointers that are 16-byte 
aligned on AMD64 but, in general, pointers don't have the be aligned that way.  
If you have a structure that contains a "long double" then that member also has 
to be 16-bit aligned.

It seems to me that we don't need to have the PyObject structure containing a 
Python float to be 16-byte aligned.  If so, could we introduce a new obmalloc 
API that returns memory with 8-byte alignment, for use by objects that know 
they don't require 16-byte alignment?  floatobject.c could use this API to 
avoid the 33% overhead.

The new obmalloc API could initially be internal use only until we can come up 
with a design we know we can live with long term.

--

___
Python tracker 

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



[issue36998] distutils sdist command fails to create MANIFEST if any filenames are undecodable

2019-05-21 Thread Toshio Kuratomi


Toshio Kuratomi  added the comment:

Are the distutils unittests disabled?  And if so is there a reason?  I was 
looking to add test cases to my PR and found that I couldn't get them (or 
indeed any distutils unittests) to run when trying to only target the distutils 
unittests.

>From looking at the code my guess is that the Python test suite was ported to 
>use the load_test protocol sometime after Python-3.2 but distutils was missed. 
> I can submit a PR to change that unless there's a reason it is the way it is.

--
nosy: +vstinner

___
Python tracker 

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



[issue37003] ast unparse does not support f-string new debug format.

2019-05-21 Thread Eric V. Smith


Eric V. Smith  added the comment:

Never mind on the failing code. I see your test cases now.

--

___
Python tracker 

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



[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-21 Thread Guido van Rossum


Guido van Rossum  added the comment:

How many more PRs do you plan? Or is this it?

--

___
Python tracker 

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



[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-21 Thread Michael Sullivan


Change by Michael Sullivan :


--
pull_requests: +13391

___
Python tracker 

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



[issue36998] distutils sdist command fails to create MANIFEST if any filenames are undecodable

2019-05-21 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



[issue36998] distutils sdist command fails to create MANIFEST if any filenames are undecodable

2019-05-21 Thread Toshio Kuratomi


Toshio Kuratomi  added the comment:

Okay, pushed a fix for regenerating the MANIFEST as well.

--

___
Python tracker 

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



[issue37003] ast unparse does not support f-string new debug format.

2019-05-21 Thread Eric V. Smith

Eric V. Smith  added the comment:

I don’t think this is worth changing. I’m planning on removing the expr_text 
field before beta 1. At which point I don’t think there will be any work to do 
here. 

See https://mail.python.org/pipermail/python-dev/2019-May/157493.html

Also, can you explain what’s currently broken? I’ll need to see some example 
code that doesn’t work in order to understand your change and if the ast change 
will affect it.

--

___
Python tracker 

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



[issue36998] distutils sdist command fails to create MANIFEST if any filenames are undecodable

2019-05-21 Thread Toshio Kuratomi


Toshio Kuratomi  added the comment:

Uploading a minimal test case.

$ tar -xzvf test-case.tar.gz
$ python3.7 setup.py sdist
running sdist
running check
warning: sdist: standard file not found: should have one of README, README.txt, 
README.rst

reading manifest template 'MANIFEST.in'
writing manifest file 'MANIFEST'
Traceback (most recent call last):
  File "setup.py", line 27, in 
packages=['hello'],
  File "/usr/lib64/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
  File "/usr/lib64/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
  File "/usr/lib64/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
  File "/usr/lib64/python3.7/distutils/command/sdist.py", line 152, in run
self.get_file_list()
  File "/usr/lib64/python3.7/distutils/command/sdist.py", line 208, in 
get_file_list
self.write_manifest()
  File "/usr/lib64/python3.7/distutils/command/sdist.py", line 390, in 
write_manifest
"writing manifest file '%s'" % self.manifest)
  File "/usr/lib64/python3.7/distutils/cmd.py", line 335, in execute
util.execute(func, args, msg, dry_run=self.dry_run)
  File "/usr/lib64/python3.7/distutils/util.py", line 291, in execute
func(*args)
  File "/usr/lib64/python3.7/distutils/file_util.py", line 236, in write_file
f.write(line + "\n")
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcff' in position 
11: surrogates not allowed

With PR applied:

$ ../../python setup.py sdist
running sdist
running check
warning: sdist: standard file not found: should have one of README, README.txt, 
README.rst

reading manifest template 'MANIFEST.in'
writing manifest file 'MANIFEST'
creating hello-1.0
creating hello-1.0/hello
creating hello-1.0/tests
creating hello-1.0/tests/data
making hard links in hello-1.0...
hard linking setup.py -> hello-1.0
hard linking hello/__init__.py -> hello-1.0/hello
hard linking tests/test_cases.py -> hello-1.0/tests
hard linking tests/data/1.bin -> hello-1.0/tests/data
hard linking tests/data/\udcff.bin -> hello-1.0/tests/data
Creating tar archive
removing 'hello-1.0' (and everything under it)

Making this minimal test case, though, I found that there's another error 
somewhere when MANIFEST has already been created (ie: the patched version works 
for the initial generation of MANIFEST but it doesn't work to *regenerate* the 
MANIFEST).  Looking into that now.

--
Added file: https://bugs.python.org/file48349/test-case.tar.gz

___
Python tracker 

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



[issue27737] email.header.Header.encode() crashes with IndexError on spaces only value

2019-05-21 Thread Batuhan


Change by Batuhan :


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



[issue36941] Windows build changes for Windows ARM64

2019-05-21 Thread Paul Monson


Change by Paul Monson :


--
pull_requests: +13389

___
Python tracker 

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



[issue36998] distutils sdist command fails to create MANIFEST if any filenames are undecodable

2019-05-21 Thread STINNER Victor

STINNER Victor  added the comment:

Éric Araujo asked me to review https://github.com/python/cpython/pull/13467. I 
gave my feedback. I now remove myself from this issue, since I'm not sure that 
I would like to be involved in a packaging module (distutils) :-) I let others 
to take a decision on these topics ;-)

--

___
Python tracker 

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



[issue36948] NameError in urllib.request.URLopener.retrieve

2019-05-21 Thread Berker Peksag


Berker Peksag  added the comment:

Thanks!

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



[issue36948] NameError in urllib.request.URLopener.retrieve

2019-05-21 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 2725cb01d7cbf5caecb51cc20d97ba324b09ce96 by Berker Peksag in 
branch 'master':
bpo-36948: Fix test_urlopener_retrieve_file on Windows (GH-13476)
https://github.com/python/cpython/commit/2725cb01d7cbf5caecb51cc20d97ba324b09ce96


--

___
Python tracker 

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



[issue36998] distutils sdist command fails to create MANIFEST if any filenames are undecodable

2019-05-21 Thread Toshio Kuratomi


Toshio Kuratomi  added the comment:

>From my initial description:

"An sdist may contain files whose names are undecodable in the current locale.  
For instance, the sdist might include some files for testing whose filenames 
are undecodable because that's the format of the input for that application."

--

___
Python tracker 

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



[issue36997] Document that spwd is considered harmful

2019-05-21 Thread STINNER Victor


STINNER Victor  added the comment:

"... must go through PAM."

Do you have a Python module to recommend to access PAM API?

--

___
Python tracker 

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



[issue36997] Document that spwd is considered harmful

2019-05-21 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



[issue34616] implement "Async exec"

2019-05-21 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

> Maybe you used "git merge" and your PR "contained" changes from other issues?

I quasi-nerver merge, either `rebase interactive` or `reset --hard HEAD`... I 
even proscribed "git pull" from my CLI.. but you know everybody does mistakes. 

> Would be great if you could make a PR to add an entry to whatsnew/3.8.rst (as 
> Victor suggests)

Ok, i'll do this.

--

___
Python tracker 

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



[issue34616] implement "Async exec"

2019-05-21 Thread STINNER Victor


STINNER Victor  added the comment:

> And I'm guessing you will collect what's in NEWS.d ? Otherwise I'm happy to 
> contribute some text. let me know the best way.

One option to document it is to add a new "builtins" section to document the 
new flag inside "Improved Modules" category:
https://docs.python.org/dev/whatsnew/3.8.html#improved-modules

--

___
Python tracker 

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



[issue34616] implement "Async exec"

2019-05-21 Thread Yury Selivanov


Yury Selivanov  added the comment:

> And I'm guessing you will collect what's in NEWS.d ? Otherwise I'm happy to 
> contribute some text. let me know the best way.

Would be great if you could make a PR to add an entry to whatsnew/3.8.rst (as 
Victor suggests)

--

___
Python tracker 

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



[issue34616] implement "Async exec"

2019-05-21 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

> Yes, Elvis and I will take care of that later.

And I'm guessing you will collect what's in NEWS.d ? Otherwise I'm happy to 
contribute some text. let me know the best way.

--

___
Python tracker 

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



[issue34616] implement "Async exec"

2019-05-21 Thread STINNER Victor


STINNER Victor  added the comment:

> Could it be due to rebasing and force-pushing ? Cause I did force-push on 
> this branch a couple of times...

Maybe you used "git merge" and your PR "contained" changes from other issues?

--

___
Python tracker 

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



[issue34616] implement "Async exec"

2019-05-21 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

> Any idea why PR 13148 has been linked to unrelated bugs.python.org issues?

Could it be due to rebasing and force-pushing ? Cause I did force-push on this 
branch a couple of times...

--

___
Python tracker 

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



[issue36998] distutils sdist command fails to create MANIFEST if any filenames are undecodable

2019-05-21 Thread STINNER Victor


STINNER Victor  added the comment:

> There's a need to handle files which are undecodable and encoding to utf-8 
> won't fix that.

Are you talking about the initial issue, get_file_list() which fails on writing 
into the MANIFEST file?

For me, a package should be "portable": it should work on most if not all 
platforms, and so use common characters which are encodable by most locale 
encodings, no?

What is your use case? Package something on Linux and then install it on Linux? 
What is your locale?

Did you try Python 3.7 or newer which speaks UTF-8 when the locale is not set?

--

___
Python tracker 

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



[issue36948] NameError in urllib.request.URLopener.retrieve

2019-05-21 Thread David Bolen


David Bolen  added the comment:

Oh, and just for historical purposes, it looks like the root cause was that the 
nturl2path.pathnametourl forces an uppercase drive letter.  So that's where the 
inconsistency in the test got introduced.

--

___
Python tracker 

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



[issue35363] test_eintr: test_open() hangs randomly on x86-64 El Capitan 3.x buildbot

2019-05-21 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -13384

___
Python tracker 

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



[issue34616] implement "Async exec"

2019-05-21 Thread STINNER Victor


STINNER Victor  added the comment:

> Yes, Elvis and I will take care of that later.

Well, it would be nice to get a first mention before the next release, to see 
all new shiny Python 3.8 features ;-) The text can be reworded later if needed 
;-)

--

___
Python tracker 

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



[issue35363] test_eintr: test_open() hangs randomly on x86-64 El Capitan 3.x buildbot

2019-05-21 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -10550

___
Python tracker 

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



[issue34616] implement "Async exec"

2019-05-21 Thread STINNER Victor


STINNER Victor  added the comment:

Any idea why PR 13148 has been linked to unrelated bugs.python.org issues? I 
saw 3 of them: bpo-35363, bpo-25234, bpo-33725.

https://mail.python.org/pipermail/python-dev/2019-May/157592.html

--

___
Python tracker 

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



[issue34616] implement "Async exec"

2019-05-21 Thread Yury Selivanov


Yury Selivanov  added the comment:

> Would it be possible to document this change in What's New in Python 3.8?

Yes, Elvis and I will take care of that later.

--

___
Python tracker 

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



[issue36948] NameError in urllib.request.URLopener.retrieve

2019-05-21 Thread David Bolen


David Bolen  added the comment:

Yes, PR 13476 tested locally on the Win10 builder resolves the error.

--

___
Python tracker 

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



[issue34616] implement "Async exec"

2019-05-21 Thread STINNER Victor


STINNER Victor  added the comment:

Would it be possible to document this change in What's New in Python 3.8?

--
nosy: +vstinner

___
Python tracker 

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



[issue36948] NameError in urllib.request.URLopener.retrieve

2019-05-21 Thread Berker Peksag


Berker Peksag  added the comment:

Thank you for the heads up, David. Could you please take a look at PR 13476?

--

___
Python tracker 

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



[issue37003] ast unparse does not support f-string new debug format.

2019-05-21 Thread Larry Hastings


Change by Larry Hastings :


--
assignee:  -> eric.smith
nosy: +eric.smith

___
Python tracker 

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



[issue36948] NameError in urllib.request.URLopener.retrieve

2019-05-21 Thread Berker Peksag


Change by Berker Peksag :


--
pull_requests: +13388
stage: resolved -> patch review

___
Python tracker 

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



[issue36998] distutils sdist command fails to create MANIFEST if any filenames are undecodable

2019-05-21 Thread Toshio Kuratomi


Toshio Kuratomi  added the comment:

I like the idea of defaulting to UTF-8 (although I think you'll have to build 
consensus as to whether that's the right thing to do here) but it won't handle 
the use case here.  There's a need to handle files which are undecodable and 
encoding to utf-8 won't fix that.

--

___
Python tracker 

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



[issue36948] NameError in urllib.request.URLopener.retrieve

2019-05-21 Thread Berker Peksag


Change by Berker Peksag :


--
status: closed -> open

___
Python tracker 

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



[issue36817] Add = to f-strings for easier debugging.

2019-05-21 Thread Matthias Bussonnier

Matthias Bussonnier  added the comment:

I'm not quite sure I completely understand how this is implemented and all the 
possibilities;  – so I would appreciate reviews on the issue (and patch) to 
handle this in ast-unparse. 

See https://bugs.python.org/issue37003

Thanks,

--
nosy: +mbussonn

___
Python tracker 

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



[issue37003] ast unparse does not support f-string new debug format.

2019-05-21 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


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

___
Python tracker 

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



[issue37003] ast unparse does not support f-string new debug format.

2019-05-21 Thread Matthias Bussonnier


New submission from Matthias Bussonnier :

All in title, f"{x=}" implemented in https://bugs.python.org/issue36817
are not liked by unparse:  https://github.com/python/cpython/pull/13473,

--
components: Library (Lib)
messages: 343105
nosy: mbussonn
priority: normal
severity: normal
status: open
title: ast unparse does not support f-string new debug format.
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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-05-21 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Assigning to Larry to decide if he wants to merge that PR into 3.5 or not.

--
assignee:  -> larry
nosy: +larry

___
Python tracker 

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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-05-21 Thread Gregory P. Smith


Change by Gregory P. Smith :


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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-05-21 Thread Gregory P. Smith


Change by Gregory P. Smith :


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



[issue36948] NameError in urllib.request.URLopener.retrieve

2019-05-21 Thread David Bolen


David Bolen  added the comment:

Since this patch was introduced to the 3.x branch my Windows 7 and 10 buildbots 
have been failing in test_urlopener_retrieve_file.  See 
https://buildbot.python.org/all/#/builders/3/builds/2661 for the first such 
failure on the Win10 worker.

The problem appears to be related to those workers having an explicit TEMP 
folder that happens to use a lowercase drive letter, causing the test assertion 
to fail due to differing case in the drive letter.

While I could work around this by changing my builder TEMP definition, the test 
seems fragile on case-insensitive filesystems, so perhaps it should be 
comparing a normalized path instead?

--
nosy: +db3l

___
Python tracker 

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



[issue36998] distutils sdist command fails to create MANIFEST if any filenames are undecodable

2019-05-21 Thread STINNER Victor


STINNER Victor  added the comment:

IMHO MANIFEST should always be encoded to UTF-8 on all platforms. It means 
always *decode* it from UTF-8.

For backward compatibility, we might first try to decode it from UTF-8, but 
falls back on the locale encoding if the UTF-8 decoder raises a 
UnicodeDecodeError.

--

___
Python tracker 

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



[issue36998] distutils sdist command fails to create MANIFEST if any filenames are undecodable

2019-05-21 Thread STINNER Victor


STINNER Victor  added the comment:

The traceback comes from Python 3.5. Python 3.7 now uses UTF-8 when the 
LC_CTYPE locale is "C" or "POSIX", thanks to C locale coercion (PEP 538) and 
UTF-8 Mode (PEP 540):
https://vstinner.github.io/posix-locale.html
https://vstinner.github.io/python37-new-utf8-mode.html

Can you please retry your test using Python 3.7?

I would prefer to not start to use errors="surrogateescape" everywhere, 
especially if the issue is already fixed.

errors="surrogateescape" basically means: "I want to produce a file that other 
people will unable to read...

---

def write_file (filename, contents):
"""Create a file with the specified name and write 'contents' (a
sequence of strings without line terminators) to it.
"""
f = open(filename, "w")
...

For me, the first obvious bug is that the encoding is not specified. I don't 
see how an application on a different computer is supposed to read a text file 
if the encoding is not well defined...

--
nosy: +vstinner

___
Python tracker 

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



[issue37002] PyType_FromSpec can't create immutable types

2019-05-21 Thread Dino Viehland


New submission from Dino Viehland :

This is another catch of using PyType_FromSpec (similar to  
https://bugs.python.org/issue26979 but also completely different).

Because PyType_FromSpec produces a heap type it gets the Py_TPFLAGS_HEAPTYPE 
flag set on the newly produced type.  To enforce the immutability of built-in 
types type_setattro checks this flag.  Therefore these types end up being 
mutable, e.g:

import _ssl
_ssl.SSLError.x = 42

In addition to not providing parity for replacing PyType_Ready in the stable 
API, it also means that this could presumably bleed across sub-interpreters or 
just provide surprising and bad results.

--
components: Interpreter Core
messages: 343100
nosy: dino.viehland, eric.snow, vstinner
priority: normal
severity: normal
status: open
title: PyType_FromSpec can't create immutable types
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



[issue33725] Python crashes on macOS after fork with no exec

2019-05-21 Thread Ned Deily


Change by Ned Deily :


--
pull_requests:  -13382

___
Python tracker 

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



[issue35907] [security][CVE-2019-9948] Unnecessary URL scheme exists to allow local_file:// reading file in urllib

2019-05-21 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13386

___
Python tracker 

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



[issue34616] implement "Async exec"

2019-05-21 Thread Ned Deily


Ned Deily  added the comment:


New changeset eca18aac7b5952d23854d27dc8e502dfb0bb0505 by Ned Deily (Yury 
Selivanov) in branch 'master':
bpo-34616: Fix code style and unbreak buildbots (GH-13473)
https://github.com/python/cpython/commit/eca18aac7b5952d23854d27dc8e502dfb0bb0505


--
nosy: +ned.deily

___
Python tracker 

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



[issue25234] test_eintr.test_os_open hangs under Xcode 7

2019-05-21 Thread Ned Deily


Change by Ned Deily :


--
pull_requests:  -13383

___
Python tracker 

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



[issue35907] [security][CVE-2019-9948] Unnecessary URL scheme exists to allow local_file:// reading file in urllib

2019-05-21 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b15bde8058e821b383d81fcae68b335a752083ca by Victor Stinner (SH) 
in branch '2.7':
bpo-35907, CVE-2019-9948: urllib rejects local_file:// scheme  (GH-11842)
https://github.com/python/cpython/commit/b15bde8058e821b383d81fcae68b335a752083ca


--

___
Python tracker 

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



[issue19376] document that strptime() does not support the Feb 29 if the format does not contain the year

2019-05-21 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Abhishek Kumar Singh! more doc is really helpful, handling date and time 
is hard :-(

--

___
Python tracker 

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



[issue34616] implement "Async exec"

2019-05-21 Thread Yury Selivanov


Change by Yury Selivanov :


--
pull_requests: +13385

___
Python tracker 

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



[issue37001] symtable.symtable doesn't accept bytes which leads to a mismatch from compile()

2019-05-21 Thread Dino Viehland


New submission from Dino Viehland :

symtable is useful when combined with compile() to AST to understand what the 
names bind to.  But symtable.symtable() doesn't accept a bytes object, while 
compile does.  Ultimately these feed down to the same API, and could easily 
lead to subtle mismatches due to encodings. 

The workaround seems to be to use the tokenize.detect_encoding to discover the 
encoding and then do the encoding from Python, but this seems wasteful.

--
assignee: dino.viehland
components: Library (Lib)
messages: 343096
nosy: dino.viehland
priority: normal
severity: normal
status: open
title: symtable.symtable doesn't accept bytes which leads to a mismatch from 
compile()
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



[issue36999] Expose the coroutine object in asyncio task objects

2019-05-21 Thread Alex Grönholm

Alex Grönholm  added the comment:

I'll look into making a PR.

--

___
Python tracker 

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



[issue37000] _randbelow_with_getrandbits function inefficient with powers of two

2019-05-21 Thread Mathis Hammel


New submission from Mathis Hammel :

In case _randbelow_with_getrandbits is called with a power of two as its 
argument (say 2^k), the function will consume k+1 random bits instead of k.

Instead of never being rejected, the sampled number will be rejected on average 
once per call, causing a computational overhead in addition to wasting k+2 bits 
on average.

This is due to taking n.bit_size() instead of (n-1).bit_size() for the size of 
the random candidates. Using n instead of n-1 is apparently deliberate in order 
to save the case where n = 1, but this could be avoided by directly returning 0 
if n == 1.

--
components: Library (Lib)
messages: 343094
nosy: Mathis Hammel, mark.dickinson, rhettinger
priority: normal
severity: normal
status: open
title: _randbelow_with_getrandbits function inefficient with powers of two
type: performance
versions: Python 2.7, Python 3.5, 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



[issue36999] Expose the coroutine object in asyncio task objects

2019-05-21 Thread Yury Selivanov


Yury Selivanov  added the comment:

I've no problem with this. We can add a 'get_coro()' Task method (this is in 
line with asyncio usually having the "getter" api as opposed to properties).

--

___
Python tracker 

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



[issue36999] Expose the coroutine object in asyncio task objects

2019-05-21 Thread Alex Grönholm

New submission from Alex Grönholm :

Both curio and trio expose the coroutine object belonging to a task as the 
"coro" attribute. Asyncio exposes this as "_coro" (as does uvloop) but it would 
be nice to have at least a read-only attribute exposing this as part of the 
public API.

In some of my libraries I need this object, sometimes for debugging and other 
times for implementing "crazy" schemes like running parts of the the coroutine 
function code in a worker thread.

--
components: asyncio
messages: 343092
nosy: alex.gronholm, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Expose the coroutine object in asyncio task objects
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue35363] test_eintr: test_open() hangs randomly on x86-64 El Capitan 3.x buildbot

2019-05-21 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


--
pull_requests: +13384

___
Python tracker 

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



[issue25234] test_eintr.test_os_open hangs under Xcode 7

2019-05-21 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


--
pull_requests: +13383

___
Python tracker 

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



[issue33725] Python crashes on macOS after fork with no exec

2019-05-21 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


--
pull_requests: +13382

___
Python tracker 

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



[issue25652] collections.UserString.__rmod__() raises NameError

2019-05-21 Thread miss-islington

miss-islington  added the comment:


New changeset 7abf8c60819d5749e6225b371df51a9c5f1ea8e9 by Miss Islington (bot) 
(Batuhan Taşkaya) in branch 'master':
bpo-25652: Fix __rmod__ of UserString (GH-13326)
https://github.com/python/cpython/commit/7abf8c60819d5749e6225b371df51a9c5f1ea8e9


--
nosy: +miss-islington

___
Python tracker 

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



[issue34616] implement "Async exec"

2019-05-21 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Great!

--

___
Python tracker 

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



[issue34616] implement "Async exec"

2019-05-21 Thread Yury Selivanov


Change by Yury Selivanov :


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

___
Python tracker 

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



[issue34616] implement "Async exec"

2019-05-21 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 565b4f1ac7304d1e690c404ca8316f383ba60862 by Yury Selivanov 
(Matthias Bussonnier) in branch 'master':
bpo-34616: Add PyCF_ALLOW_TOP_LEVEL_AWAIT to allow top-level await (GH-13148)
https://github.com/python/cpython/commit/565b4f1ac7304d1e690c404ca8316f383ba60862


--

___
Python tracker 

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



Python WebApp where Python runs on the client's machine using Pyodide

2019-05-21 Thread Simon Biggs
It's still a massive work in progress, but I though people here might be
interested in the progress made thus far:
https://app.pymedphys.com/

It is a file processing application. It has input files and output files.
Users select input files from their computer, select a script to run (or
edit a script to create their own) and then it produces the output files
which can be downloaded.
At the moment when Python is running the user interface freezes but to fix
that I am told I just need to get my head around web workers (
https://github.com/iodide-project/pyodide/issues/435#issuecomment-493928297
).

It's been quite fun!

Also, adding new scripts to the web app should be as simple as following
the steps laid out over here:
https://github.com/pymedphys/pymedphys/issues/312

I'm keen for feedback, please let me know what you think!

I'll likely post this again in the near future once I fix up the freezing
and I have also provided a few more example scripts.

Cheers,
Simon
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36996] unittest.mock.patch decorator doesn't work with async functions

2019-05-21 Thread Lisa Roach


Lisa Roach  added the comment:

Oops, didn't see your post. Thanks!

--

___
Python tracker 

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



[issue36996] unittest.mock.patch decorator doesn't work with async functions

2019-05-21 Thread Lisa Roach


Lisa Roach  added the comment:

I quickly threw in Andrew's code to check it and looks like it does fix the 
problem. I'd be happy to add it in but I'll give @xtreak first dibs.

Thanks for finding this :)

--

___
Python tracker 

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



[issue36996] unittest.mock.patch decorator doesn't work with async functions

2019-05-21 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks @asvetlov for the explanation. I tried the patch and it works fine for 
my example with no test failures for mock. I will try to make a PR. Only 
func(*args, **keywargs) needs to be changed and await requires an async 
function which I seem to need duplicating the function. I will try if I can 
refactor that. I will post a PR where this can be discussed.

--

___
Python tracker 

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



[issue26460] datetime.strptime without a year fails on Feb 29

2019-05-21 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

See also issue19376. This behavior is now documented with 
https://github.com/python/cpython/commit/56027ccd6b9dab4a090e4fef8574933fb9a36ff2

--
nosy: +xtreak

___
Python tracker 

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



  1   2   3   >