[issue34529] add the option for json.dumps to return newline delimited json

2018-08-30 Thread ron


ron  added the comment:

I'm a bit confused here.

On one hand you say it's two lines of code. On other hand you suggest that each 
service provider will implement it's own functions.

What's the harm from adding - small , unbreakable functionality? 

Your points for small code could have also been raised against implementing 
reverse() - yet Python still implemented it - saved the 2 line code from the 
developer.

At the end.. small change or not.. This is a new format.
Conversion between formats are required from any programming language..

--

___
Python tracker 

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



[issue34529] add the option for json.dumps to return newline delimited json

2018-08-30 Thread Bob Ippolito


Bob Ippolito  added the comment:

I suggested that each module would likely implement its own functions tailored 
to that project's IO and error handling requirements. The implementation may 
differ slightly depending on the protocol. This is consistent with how JSON is 
typically dealt with from a web framework, for example.

--

___
Python tracker 

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



[issue34546] Zipfile encryption function

2018-08-30 Thread 大野隆弘

New submission from 大野隆弘 :

from https://mail.python.org/pipermail/python-ideas/2018-August/053081.html

I would like to use zipfile encryption as python standard library.
https://github.com/python/cpython/blob/master/Lib/zipfile.py

Below document says "currently" cannot.
https://github.com/python/cpython/blob/master/Doc/library/zipfile.rst
"but it currently cannot create an encrypted file."

Current pythonians like me have to use 3rd party like below, but I believe it 
is worth to include.
https://pypi.org/project/pyminizip/
https://github.com/wllm-rbnt/py-zipcrypt

--
components: Library (Lib)
messages: 324372
nosy: 大野隆弘
priority: normal
severity: normal
status: open
title: Zipfile encryption function
type: enhancement

___
Python tracker 

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



[issue33965] [Windows WSL] Fatal Python error: _Py_InitializeMainInterpreter: can't initialize time, after year 2038

2018-08-30 Thread Petter S


Petter S  added the comment:

I am updating this bug since someone may find it.

The problem lies with WSL. After having my computer running for many days, this 
is the result of the uptime command:

$ uptime
 11:23:19 up -24855 days, -3:-14,  0 users,  load average: 0.52, 0.58, 0.59

Restarting the computer fixes this and the Python issue discussed in this 
thread.

--

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-08-30 Thread Tal Einat


Tal Einat  added the comment:

> 1. Yes.  Always show.  Fix delay at 80 until we decide on something better.

Done.

> 2. No.  Max should be enough.

Done.

> I once printed over 500_000 short lines to see if scrolling remained 
> responsive.  It did.  I could have set min to 1_000_000 for that experiment.  
> Am I correct in presuming that only one block of output, between code imputs, 
> can be squeezed?

Indeed.

> 3. No, if not gone already.  I don't want to proliferate keyboard shortcuts, 
> at least not until we get rid of some that must be nearly unused.

Done.

> 4. Maybe  chars would be better.

I'm still not sure, that just leads to very large numbers, where it's hard to 
judge what is excessive, e.g., "is 100,000 chars too much"?  With lines, I feel 
it is more obvious: "1,000 lines? That's way too much!"

> The viewer does not wrap.  I think it should as there is now no way to see 
> entire line.  Or it needs a scrollbar.

Wrapping is the major cause of the text widget slowing down, which is why I've 
made the viewer support controlling the wrapping mode, and made Squeezer use no 
wrapping.  I've now added a horizontal scrollbar, and also made the scrollbars 
in the viewer appear only when needed.  Now, scrolling horizontally with very 
long lines is still slow, but at least just the viewer is affected.

> Viewer is modal, but does it need to be?

No, good catch, changed to non-modal.

--

___
Python tracker 

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



[issue34547] Wsgiref server does not handle closed connections gracefully

2018-08-30 Thread Petter S


New submission from Petter S :

The server in the wsgiref module is actually used a lot. For example, it is the 
server Django uses for development.

A very common thing that happens during Django development is that the web 
browser closes the connection for some reason. Then very long stack traces 
appear in the Django logs:

[30/Aug/2018 12:10:38] "POST /login/ HTTP/1.1" 200 3964
Traceback (most recent call last):
  File "d:\python37\Lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
  File "d:\python37\Lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
  File "d:\python37\Lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
  File "d:\python37\Lib\wsgiref\handlers.py", line 332, in send_headers
self.send_preamble()
  File "d:\python37\Lib\wsgiref\handlers.py", line 255, in send_preamble
('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
  File "d:\python37\Lib\wsgiref\handlers.py", line 453, in _write
result = self.stdout.write(data)
  File "d:\python37\Lib\socketserver.py", line 796, in write
self._sock.sendall(b)
ConnectionAbortedError: [WinError 10053] An established connection was 
aborted by the software in your host machine
[30/Aug/2018 12:10:38] "POST /login/ HTTP/1.1" 500 59

Exception happened during processing of request from ('127.0.0.1', 50112)
Traceback (most recent call last):
  File "d:\python37\Lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
  File "d:\python37\Lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
  File "d:\python37\Lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
  File "d:\python37\Lib\wsgiref\handlers.py", line 332, in send_headers
self.send_preamble()
  File "d:\python37\Lib\wsgiref\handlers.py", line 255, in send_preamble
('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
  File "d:\python37\Lib\wsgiref\handlers.py", line 453, in _write
result = self.stdout.write(data)
  File "d:\python37\Lib\socketserver.py", line 796, in write
self._sock.sendall(b)
ConnectionAbortedError: [WinError 10053] An established connection was 
aborted by the software in your host machine

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "d:\python37\Lib\wsgiref\handlers.py", line 141, in run
self.handle_error()
  File 
"D:\Virtualenvs\ledev-X6wd5Q8f\lib\site-packages\django\core\servers\basehttp.py",
 line 86, in handle_error
super().handle_error()
  File "d:\python37\Lib\wsgiref\handlers.py", line 368, in handle_error
self.finish_response()
  File "d:\python37\Lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
  File "d:\python37\Lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
  File "d:\python37\Lib\wsgiref\handlers.py", line 331, in send_headers
if not self.origin_server or self.client_is_modern():
  File "d:\python37\Lib\wsgiref\handlers.py", line 344, in client_is_modern
return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "d:\python37\Lib\socketserver.py", line 647, in 
process_request_thread
self.finish_request(request, client_address)
  File "d:\python37\Lib\socketserver.py", line 357, in finish_request
self.RequestHandlerClass(request, client_address, self)
  File "d:\python37\Lib\socketserver.py", line 717, in __init__
self.handle()
  File 
"D:\Virtualenvs\ledev-X6wd5Q8f\lib\site-packages\django\core\servers\basehttp.py",
 line 154, in handle
handler.run(self.server.get_app())
  File "d:\python37\Lib\wsgiref\handlers.py", line 144, in run
self.close()
  File "d:\python37\Lib\wsgiref\simple_server.py", line 35, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'



Obviously, this is a bit annoying when developing with Django daily. Since 
Django simply uses the wsgiref server, I though the best solution was to handle 
closed connections more gracefully there.

I think the best solution is to simply add another except clause here: 
https://github.com/python/cpython/blob/e6dac0077996b1e1f886f036d6f2606237fa4c85/Lib/wsgiref/handlers.py#L142
 . We should catch ConnectionAbortedError here and return from the function.

I am happy to create a PR if this is what we want to do.

--
components: Library (Lib)
messages: 324375
nosy: Petter S
priority: normal
seve

[issue34547] Wsgiref server does not handle closed connections gracefully

2018-08-30 Thread Petter S


Change by Petter S :


--
type:  -> enhancement

___
Python tracker 

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



[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-08-30 Thread ernest ruiz


Change by ernest ruiz :


--
type: crash -> enhancement

___
Python tracker 

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



[issue26901] Argument Clinic test is broken

2018-08-30 Thread STINNER Victor


STINNER Victor  added the comment:

Pablo, Serhiy: there are now 2 PR (one written by Pablo, one by me). Would you 
mind to have a look and tell me what is your preferred PR? My PR is based on 
Pablo's PR, I just changed how the tests are run to make sure that they are run 
on *all* CIs, not just Travis CI.

--

___
Python tracker 

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



[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2018-08-30 Thread Berker Peksag


Change by Berker Peksag :


--
type: enhancement -> crash

___
Python tracker 

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



[issue34545] error in the repl due to indentation

2018-08-30 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> third party
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue33965] [Windows WSL] Fatal Python error: _Py_InitializeMainInterpreter: can't initialize time, after year 2038

2018-08-30 Thread STINNER Victor


STINNER Victor  added the comment:

> 11:23:19 up -24855 days, -3:-14,  0 users,  load average: 0.52, 0.58, 0.59

Impressive uptime!

--

___
Python tracker 

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



[issue34544] FreeBSD: Fatal Python error: get_locale_encoding: failed to get the locale encoding: nl_langinfo(CODESET) failed

2018-08-30 Thread STINNER Victor


STINNER Victor  added the comment:

I cannot reproduce the issue on my FreeBSD 11.1 VM. I cannot reproduce the 
issue on Koobs's "CURRENT-amd64%" buildbot neither :-(

Example:

CURRENT-amd64% env -i LC_ALL=invalid LC_CTYPE=invalid LANG=invalid PYTHONUTF8=0 
PYTHONCOERCECLOCALE=0 ./python -X utf8=0 -c pass  

(no error)

--

___
Python tracker 

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



[issue34489] subprocess: execution of batch-files (.cmd/.bat) is vulnerable in python for windows / insufficient escape

2018-08-30 Thread Sergey G. Brester


Sergey G. Brester  added the comment:

I have extended the PR a bit (more tests and corresponding documentation part).

--

___
Python tracker 

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



[issue34530] distutils: find_executable() fails if the PATH environment variable is not set

2018-08-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

find_executable() always searches executables from the current directory. This 
effectively equivalent having os.curdir at the start of path. shutil.which() 
does this only on Windows. This change LGTM, but it potentially can break user 
code, thus it may be not safe to make it in maintained versions.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34548] IDLE: Make TextView use the configured theme colors

2018-08-30 Thread Tal Einat


Change by Tal Einat :


--
assignee: taleinat
components: IDLE
nosy: taleinat, terry.reedy
priority: low
severity: normal
status: open
title: IDLE: Make TextView use the configured theme colors
versions: Python 2.7, 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



[issue34548] IDLE: Make TextView use the configured theme colors

2018-08-30 Thread Tal Einat


Change by Tal Einat :


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

___
Python tracker 

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



[issue34530] distutils: find_executable() fails if the PATH environment variable is not set

2018-08-30 Thread STINNER Victor


STINNER Victor  added the comment:

> find_executable() always searches executables from the current directory.

Oh! I didn't notice that!

--

___
Python tracker 

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



[issue34539] namedtuple's exec() throws segmentation fault

2018-08-30 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34485] _PyCoreConfig: add stdio_encoding and stdio_errors

2018-08-30 Thread Nick Coghlan


Nick Coghlan  added the comment:

Yeah, there were some good reasons I went with the relatively brute force 
option of provideding Blender with a new config API call back in bpo-16129 - as 
we've seen, actually fixing it properly has been a multi-year multi-person 
effort :)

--
nosy: +ncoghlan

___
Python tracker 

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



[issue21145] Add the @cached_property decorator

2018-08-30 Thread Nick Coghlan


Nick Coghlan  added the comment:

This has now been merged.

Thanks for the multiple iterations on the implementation Carl, and thanks for 
the original proposal, Omer!

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



[issue34485] _PyCoreConfig: add stdio_encoding and stdio_errors

2018-08-30 Thread STINNER Victor


STINNER Victor  added the comment:

> Yeah, there were some good reasons I went with the relatively brute force 
> option of provideding Blender with a new config API call back in bpo-16129 - 
> as we've seen, actually fixing it properly has been a multi-year multi-person 
> effort :)

Yeah, I see ;-) Thanks for Py_SetStandardStreamEncoding(), it fixed Blender use 
case!

--

___
Python tracker 

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



[issue34549] unittest docs could use another header

2018-08-30 Thread Nick


New submission from Nick :

I find myself reaching for a list of the assert methods in the unittest library 
often. There are several methods but no clear way to link a URL via a header if 
you intend to bookmark or send it out.

I have been using the method above the section in the meantime

https://docs.python.org/3.7/library/unittest.html#unittest.TestCase.debug

Would be great to have an `Assert Methods` header or some other equivalent.

Thank you!

--
assignee: docs@python
components: Documentation
messages: 324385
nosy: docs@python, napsterinblue
priority: normal
severity: normal
status: open
title: unittest docs could use another header
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



[issue21145] Add the @cached_property decorator

2018-08-30 Thread Carl Meyer


Carl Meyer  added the comment:

Thanks everyone for the thoughtful and careful reviews! Patch is much improved 
from where it started. And thanks Nick for merging.

--

___
Python tracker 

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



[issue34539] namedtuple's exec() throws segmentation fault

2018-08-30 Thread Álvaro Justen

Álvaro Justen  added the comment:

Yes, I think it was fixed in https://bugs.python.org/issue34087 (didn't see the 
commits), I just wanted to report it because I don't know if a test for this 
specific case is needed (the other bug is not related to namedtuples).

--

___
Python tracker 

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



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-08-30 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

See https://bugs.python.org/issue443559 and "git log -p 13af42822cd".

One other example from real code:  requests.RequestException

--
nosy: +fdrake

___
Python tracker 

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



[issue34550] UnicodeDecodeError when invoke method configure() of Menu instance

2018-08-30 Thread Tao Chen


New submission from Tao Chen :

[Brief Description]
Python 3.7.0 IDLE. After create one Menu instance, and invoke it's config() or 
configure() method without any parameter, python print UnicodeDecodeError.


[Walk around]
menubar = Menu(root)
menubar.config(font=('Arial'))



[LOG]
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit 
(AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> from tkinter import *
>>> root = Tk()
>>> menubar = Menu(root)
>>> menubar.config()
Traceback (most recent call last):
  File "", line 1, in 
menubar.config()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 2: invalid 
continuation byte


>>> menubar.cget('font')
Traceback (most recent call last):
  File "", line 1, in 
menubar.cget('font')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 2: invalid 
continuation byte

>>> platform.uname()
uname_result(system='Windows', node='xxx', release='7', version='6.1.7601', 
machine='AMD64', processor='Intel64 Family 6 Model 78 Stepping 3, GenuineIntel')

--
components: Tkinter
messages: 324389
nosy: sbellct
priority: normal
severity: normal
status: open
title: UnicodeDecodeError when invoke method configure() of Menu instance
type: resource usage
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



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-08-30 Thread Brett Cannon


Brett Cannon  added the comment:

I'm not questioning if people have ever created a base exception for an entire 
package, I'm just asking how often it's actually used when the base exception 
didn't make sense outside of the rule-of-thumb Nathaniel is pointing out?

For instance, it could makes sense in requests' case to have a base exception 
to help facilitate catching network-related errors but let through e.g. 
TypeError. But does that extend to most packages such that users regularly 
write an 'except' clause catching that package's common base exception type? 
That's my question and I personally don't have an answer beyond reflecting on 
this and not really remembering a case where I have (I _can_ remember following 
this pattern simply because it's habit at this point for some unknown reason :) 
.

--

___
Python tracker 

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



[issue34200] importlib: python -m test test_pkg -m test_7 fails randomly

2018-08-30 Thread Nick Coghlan


Nick Coghlan  added the comment:

Given that importlib is essentially just doing "listdir", it would be 
interesting to know how the following behaves in a tight loop on affected 
systems:

# Write a file
f = open(os.path.join(dirname, "testname.py"), "w")
f.write("text\n")
f.close()
# Make a directory
os.mkdir(os.path.join(dirname, "testname"))
# List the directory
os.listdir(dirname)

The core assumption that test_pkg is indirectly making is that the directory 
listing in importlib will always list both entries created by the test suite 
without any special care being needed at the application level.

--

___
Python tracker 

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



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-08-30 Thread Ammar Askar


Ammar Askar  added the comment:

For some empirical data, I went through some popular packages that follow this 
pattern and searched for usage of their base exception classes:

Requests: https://github.com/search?q=except+requests.RequestException&type=Code

PyYaml: https://github.com/search?q=except+yaml.YAMLError&type=Code

Jinja2: https://github.com/search?q=%22except+jinja2.TemplateError%22&type=Code

https://github.com/search?q=%22except+jinja2.exceptions.TemplateError%22&type=Code

https://github.com/search?q=%22except+TemplateError%22&type=Code

--
nosy: +ammar2

___
Python tracker 

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



[issue34427] calling MutableSequence.extend on self produces infinite loop

2018-08-30 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 1b5f9c9653f348b0aa8b7ca39f8a9361150f7dfc by Raymond Hettinger 
(Naris R) in branch 'master':
bpo-34427: Fix infinite loop when calling MutableSequence.extend() on self 
(GH-8813)
https://github.com/python/cpython/commit/1b5f9c9653f348b0aa8b7ca39f8a9361150f7dfc


--

___
Python tracker 

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



[issue34427] calling MutableSequence.extend on self produces infinite loop

2018-08-30 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thank you for the patch.

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2018-08-30 Thread Ethan Furman


Change by Ethan Furman :


--
assignee:  -> ethan.furman

___
Python tracker 

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



[issue34550] UnicodeDecodeError when invoke method configure() of Menu instance

2018-08-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34551] Redundant store can be removed from _PyFunction_FastCallDict

2018-08-30 Thread Eric Lippert


New submission from Eric Lippert :

In _PyFunction_FastCallDict we have local nk assigned to be the size of a 
dictionary, and then local i is assigned to twice the size of the same 
dictionary, and then nk is assigned to half of i, which it already is:

   nk = (kwargs != NULL) ? PyDict_GET_SIZE(kwargs) : 0;
   if (nk != 0) {
 ...
 pos = i = 0;
 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
   ...
   i += 2;
 }
 nk = i / 2;

I am attempting to understand the performance characteristics of this hot path, 
and I spent far too long trying to figure out why nk was being assigned a value 
it already has. :)

I propose that the redundant store be replaced with an assertion that i/2 is 
equal to nk.

I will submit a pull request presently.

--
components: Interpreter Core
messages: 324395
nosy: Eric Lippert
priority: normal
severity: normal
status: open
title: Redundant store can be removed from _PyFunction_FastCallDict
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



[issue34535] queue.Queue(timeout=0.001) avg delay Windows:14.5ms, Ubuntu: 0.063ms

2018-08-30 Thread Steve Dower


Steve Dower  added the comment:

Agreed with not putting platform-specific details everywhere, but in this case 
we can probably have a generic wording for "Blocks for `timeout` seconds as 
best as is available on the current operating system".

It is a general problem across all timeouts, so someone probably ought to do a 
full pass to find anywhere it matters. I'm not volunteering for that though!

About the only other possible fix is to figure out the current resolution, and 
replace any waits with shorter timeouts with a spin-lock. But in general I 
would rather leave this to the operating system and just document that we can't 
always overrule decisions made by the OS.

--

___
Python tracker 

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



[issue34551] Redundant store can be removed from _PyFunction_FastCallDict

2018-08-30 Thread Eric Lippert


Change by Eric Lippert :


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

___
Python tracker 

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



[issue34481] Different behavior of C and Python impls of datetime.strftime with non-UTF-8-encodable strings

2018-08-30 Thread Paul Ganssle


Paul Ganssle  added the comment:

@izbyshev That's totally fair and I wouldn't want to make it a condition of 
merging the existing fixes - I've already made great progress in fixing the 
time.strftime part as well.

The main reason it relates here is that I generally find the tests to be among 
the hardest part about writing a good PR, and if we can't make assertions about 
the behavior of strftime outputs, I think it makes it hard to prevent 
regressions. I figured if I can solve the problem all the way down the stack in 
one go, I might as well.

That said, Victor makes an *extremely* good point that this is an outsized 
effort for the bug it's fixing. No one really *needs* support for unpaired 
surrogates in their strftime as far as I can tell. The main reason I'm still 
working on it is that I'm curious to see if it's even possible to fix.

--

___
Python tracker 

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



[issue34445] asyncio support in doctests

2018-08-30 Thread Grant Jenks


Grant Jenks  added the comment:

This is not a bug in Python. The SyntaxError matches expected behavior. 
According to the Python grammar, you can't have "await" outside of a function. 
You have "await" at the globals scope which is not permitted. You may only 
"await" functions from within other functions.

Doctest is designed to emulate what you would type into the Python shell. Your 
doctest snippet does not work there either:


```
$ python3
Python 3.7.0 (default, Jun 28 2018, 05:55:06) 
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> async def hello_world():
... return "Hello, world!"
... 
>>> await hello_world()
  File "", line 1
SyntaxError: 'await' outside function
```

To make your doctests work, use ``asyncio.run`` like so:


```
import asyncio


async def hello_world():
"""
Will greet the world with a friendly hello.

>>> asyncio.run(hello_world())
'hello world'

"""
return "hello world"


if __name__ == "__main__":
import doctest
doctest.testmod()
```

Stefan, you may get a quicker answer next time from a forum like StackOverflow.

Yury, it's probably a good idea to cover this case in your upcoming asyncio 
docs improvements.

--
nosy: +grantjenks

___
Python tracker 

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



[issue34519] Add additional aliases for HP Roman 8

2018-08-30 Thread Michael Osipov


Michael Osipov <1983-01...@gmx.net> added the comment:

Wikipedia references it: https://en.wikipedia.org/wiki/HP_Roman#Roman-8
as well as IBM on its pages: 
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.wmqfte.doc/codepages.htm

--

___
Python tracker 

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



[issue34226] cgi.parse_multipart() requires undocumented CONTENT-LENGTH in Python 3.7

2018-08-30 Thread Tercio Gaudencio Filho


Change by Tercio Gaudencio Filho :


--
nosy: +Tercio Gaudencio Filho

___
Python tracker 

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



[issue34445] asyncio support in doctests

2018-08-30 Thread Stefan Tjarks


Stefan Tjarks  added the comment:

Thanks Grant! I expected that I am missing something.

You are right that I could have posted in many places to get help about this. 
Before posting I tried to find a doctest for asyncio but my google magic failed 
me. At the end I just felt that, at the very least, the bug tracker would show 
that the doctest documentation could be updated to cover this.

That doctest emulate a Python shell helps me understand its limitations a bit 
more.

--
resolution:  -> not a bug

___
Python tracker 

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



[issue22872] multiprocessing.Queue raises AssertionError

2018-08-30 Thread Zackery Spytz


Change by Zackery Spytz :


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



[issue22872] multiprocessing.Queue raises AssertionError

2018-08-30 Thread Zackery Spytz


Change by Zackery Spytz :


--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue34481] Different behavior of C and Python impls of datetime.strftime with non-UTF-8-encodable strings

2018-08-30 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

> if we can't make assertions about the behavior of strftime outputs, I think 
> it makes it hard to prevent regressions.

Ironically, some of the changes we may have to make to fix time.strftime() 
inconsistencies may appear like regressions to some users. For example, 
regarding dropping wcsftime() on all platforms, 'man strftime' on macOS 
contains the following warning in BUGS section: "The strftime() function does 
not correctly handle multibyte characters in the format argument.". (I'm not 
sure what "incorrect handling" means here). That's not to discourage you, just 
to point out that we should be extra careful at this point when there might be 
users relying on every variety of the current behavior. And that's also why I 
don't want to mix the fix for C vs. Python issue (low risk) with changes in 
time.strftime() (high risk).

Also, while I certainly agree with "the outsized effort" point, it seems that 
your PR goes far beyond supporting surrogates because falling back to escaping 
allows one to bypass checks in wcsftime()/strftime() and round-trip any code 
point regardless of the current locale.

--

___
Python tracker 

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



[issue34443] enum repr should use __qualname__

2018-08-30 Thread orlnub123


Change by orlnub123 :


--
pull_requests: +8481

___
Python tracker 

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



[issue34443] enum repr should use __qualname__

2018-08-30 Thread orlnub123


orlnub123  added the comment:

I've created a separate PR that also changes the __str__s.

--
nosy: +orlnub123

___
Python tracker 

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



[issue34551] Redundant store can be removed from _PyFunction_FastCallDict

2018-08-30 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> vstinner
nosy: +serhiy.storchaka, vstinner

___
Python tracker 

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



[issue34552] Clarify built-in types comparisons

2018-08-30 Thread Windson Yang


New submission from Windson Yang :

In https://docs.python.org/3.5/library/stdtypes.html#comparisons 

"some types (for example, function objects) support only a degenerate notion of 
comparison where any two objects of that type are unequal."

We had some discussion at zulipchat already:

"more seriously: I think we can just delete that sentence. The next sentence 
makes clear that < and friends arne't always defined, and the sentence after 
that notes that == defaults to is if there's nothing better." - by Nathaniel J. 
Smith

IMO, I think we should also clarify the relationship between "==", "is" and 
"__eq__".

--
assignee: docs@python
components: Documentation
messages: 324403
nosy: Windson Yang, docs@python, gvanrossum, njs, zach.ware
priority: normal
severity: normal
status: open
title: Clarify built-in types comparisons
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, 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



[issue32502] uuid1() fails if only 64-bit interface addresses are available

2018-08-30 Thread Chih-Hsuan Yen


Chih-Hsuan Yen  added the comment:

Could the fix be backported to 2.7 branch? Apparently on macOS 2.7 is also 
affected https://github.com/macports/macports-ports/pull/2456

--
nosy: +yan12125

___
Python tracker 

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



[issue34461] Availability of parsers in etree initializer

2018-08-30 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +8482

___
Python tracker 

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