[issue5755] "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++"

2018-05-14 Thread Jeroen Demeyer

Jeroen Demeyer  added the comment:

> Or just remove it

I updated the PR to do that.

I didn't want to propose that initially because that patch was proposed here 
almost 2 years ago but not accepted.

--

___
Python tracker 

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



[issue32485] Multiprocessing dict sharing between forked processes

2018-05-14 Thread Leonard Lausen

Change by Leonard Lausen :


--
nosy: +Leonard Lausen

___
Python tracker 

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



[issue33486] regen autotools related files

2018-05-14 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

If these changes are autogenerated, I would prefer that a trusted core 
developer create a PR.

Is it safe to bump the minimal required version of autotools to 2.69? This can 
prevent building Python on conservative systems.

--
nosy: +anthonybaxter, barry, benjamin.peterson, eric.araujo, georg.brandl, 
gvanrossum, lemburg, ned.deily, serhiy.storchaka, tarek

___
Python tracker 

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



[issue16865] ctypes arrays >=2GB in length causes exception

2018-05-14 Thread miss-islington

miss-islington  added the comment:


New changeset 726894addc02effaa369fded3caaba94875c1f3d by Miss Islington (bot) 
in branch '3.6':
bpo-16865: Support arrays >=2GB in ctypes. (GH-3006)
https://github.com/python/cpython/commit/726894addc02effaa369fded3caaba94875c1f3d


--

___
Python tracker 

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



[issue16865] ctypes arrays >=2GB in length causes exception

2018-05-14 Thread miss-islington

miss-islington  added the comment:


New changeset 2ce72e243fbc0e4f07f1191b20be548bfa5cbe11 by Miss Islington (bot) 
in branch '3.7':
bpo-16865: Support arrays >=2GB in ctypes. (GH-3006)
https://github.com/python/cpython/commit/2ce72e243fbc0e4f07f1191b20be548bfa5cbe11


--
nosy: +miss-islington

___
Python tracker 

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



[issue33511] Update config.sub

2018-05-14 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
title: update.config.sub -> Update config.sub

___
Python tracker 

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



[issue18022] Inconsistency between quopri.decodestring() and email.quoprimime.decode()

2018-05-14 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Many thanks David! But sorry, your table confused me. I can't read it. Could 
you please reformat it?

--

___
Python tracker 

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



[issue33463] Can namedtuple._asdict return a regular dict instead of OrderedDict?

2018-05-14 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

DeprecationWarning is for things that will be removed. This is a sign: don't 
use this feature, rewrite you code so that doesn't use it, otherwise it will be 
broken in future versions.

FutureVersion is for things that work now and will work in future, but will 
change its behavior in future. This is a sign: be prepared that your code will 
be broken in a way that will lead to returning a wrong result instead of 
failing. It is better to use alternatives until this feature be stabilized.

Both warnings are not well appropriate here. They are too loud, and there are 
no good alternatives to _asdict(). Most users don't care about additional 
methods or performance guaranties of the result, thy just need a mapping, and 
it is desirable if it preserves the order of named tuple fields. I think it 
would be better to not add a runtime warning. Instead you can add a warning in 
the documentation in previous versions (just to the versionchanged directive 
that says when _dict() started returning an OrderedDict).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33504] configparser should use dict instead of OrderedDict in 3.7+

2018-05-14 Thread Łukasz Langa

Łukasz Langa  added the comment:

I am +1 to changing it to dict for Python 3.8.

This use case is different from `namedtuple._asdict`. The type of the 
dictionary is for the purpose of internal storage of the parser. Unlike 
`namedtuple._asdict`, it is not exposed to the user.

The purpose of changing the default to OrderedDict in the past is not 
documented but implying from its properties we can deduce it was to make 
minimal edits to .ini files stable. This property will remain unchanged with 
changing the type back to `dict`.

The history here is this:
- a `dict_type` was introduced by MvL in r52908 (issue 1371075) with the 
motivation to allow sorting or order preservation (December 2006);
- the default `dict_type` was changed by Raymond to OrderedDict for 3.1 in 
0663a1ed793c164fb11d3dd62bebc677e260891e (March 2009); as far as I can tell 
there was no issue for it when that change was made.

I acknowledge that in https://bugs.python.org/issue32360 Raymond states that 
"can't just change the default argument for configparser" but I don't see why. 
ConfigParser doesn't return the dictionary to the user in any API and the new 
3.6+ dictionary preserves order just as OrderedDict.

--

___
Python tracker 

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



[issue33474] Support immutability per-field in dataclasses

2018-05-14 Thread Daniel Lindeman

Daniel Lindeman  added the comment:

A possible use case would be a field that represents an auto-incrementing 
database ID. Since the field is auto-incrementing in the database, it would be 
desirable to keep this field frozen, and others mutable once an instance of a 
data class is created. 

This is also a feature of data classes in other languages, for example Kotlin: 
https://kotlinlang.org/docs/reference/data-classes.html . The main difference 
here being that we don't have val and var, and thus mutability and immutability 
are harder to represent.

Hashing could be implemented such that frozen fields are allowed to be part of 
the hash, but unfrozen fields would remain only part of the hash when 
unsafe_hash is set. I believe equality follows from hashing, so the same rules 
should apply. 

The conflict between setting the class to frozen, and a field to not frozen 
could be solved by raising an exception.

Upon investigation, attrs does not support this behavior. I can try this 
feature with attrs, but their implementation may differ enough to make it 
infeasible.

--

___
Python tracker 

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



[issue32769] Add 'annotations' to the glossary

2018-05-14 Thread Łukasz Langa

Łukasz Langa  added the comment:

Guido, do you really want to stress at this point for Python 3.8 that 
annotations do not have an intended purpose? That is clearly not true.

1. PEP 526 was created purely with types in mind and was inspired by PEP 484's 
lack of this functionality.

2. PEP 563 defines a future import which will become the default in a future 
release (currently marked as 4.0). This default stops evaluating annotations at 
runtime, which again was inspired by the typing use case.

3. Dataclasses in PEP 557 are designed to leverage types in annotations. A few 
quotes from that PEP:

> A class decorator is provided which inspects a class definition for variables 
> with type annotations as defined in PEP 526, "Syntax for Variable 
> Annotations".

> One main design goal of Data Classes is to support static type checkers. The 
> use of PEP 526 syntax is one example of this, but so is the design of the 
> fields() function and the @dataclass decorator.

4. PEP 560 added support for `__class_getitem__` and `__mro_entries__` in core 
purely for the purpose of generic types.

5. For the above reasons, PEP 563 states that non-typing usage of annotations 
is deprecated:

https://www.python.org/dev/peps/pep-0563/#non-typing-usage-of-annotations

--
nosy: +lukasz.langa

___
Python tracker 

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



[issue33483] build system requires explicit compiler, but should discover it

2018-05-14 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 98929b545e86e7c7296c912d8f34e8e8d3fd6439 by Benjamin Peterson 
(Eitan Adler) in branch 'master':
bpo-33483: more correctly handle finding the C compiler (GH-6780)
https://github.com/python/cpython/commit/98929b545e86e7c7296c912d8f34e8e8d3fd6439


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue33506] [logging] template for filename timestamps

2018-05-14 Thread Steve R. Hastings

Steve R. Hastings  added the comment:

I just reviewed the Python 3.6 logging code.  Unless I am mistaken, it still 
has the limitation that when a logging file is active for writing log events, 
that file always has the same filename (self.baseFilename).  Did I overlook 
anything?

At rotation time, the self.namer() function is called, and it could implement 
any desired naming scheme.  However, its only argument is the already templated 
filename.

So if I needed to implement logging with a filename of: foo-mmdd.log at all 
times, how would I get the current file (the open file to which log events are 
being written) to have that pattern of name?

And if I needed to write a self.namer() function to rename to that standard, is 
this the recommended approach?

# for daily rotations, the built-in template is: "%Y-%m-%d"
def namer(self, filename):
# filename will look like: foo--mm-dd.log
year = filename[-14:-10]
month = filename[-9:-7]
day = filename[-6:-4]
base = filename[:-14]
new_filename = base + year + month + day + ".log"
return new_filename  # will look like: foo-mmdd.log

The logging event that triggered the rollover is not passed to the namer() 
function, just the templated default filename.

In my opinion, it is more convenient for the user to simply specify the desired 
format using template codes, such as:

handler = TimedRotatingFileHandler("foo", suffix="-%Y%m%d", when="D")


Also, unless I have overlooked something, using the self.namer() function to 
implement a custom naming scheme completely disables the code that 
automatically deletes the oldest backup files when backupCount is specified.  
The getBackupFilesToDelete() function uses the self.extMatch value (a 
pre-compiled regular expression) to find files to delete; with a custom naming 
scheme, the files will not match the pattern.  Therefore users with a custom 
naming scheme would have to implement some external solution to deleting old 
files after log rotation.

The code I am proposing to donate to Python automatically builds a suitable 
regular expression for the self.extMatch member variable, based on the user's 
specified format string.  I believe this is an advantage for the code I propose 
to donate.

--

___
Python tracker 

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



[issue33512] use more standard approach for detecting long double in configure

2018-05-14 Thread Eitan Adler

Change by Eitan Adler :


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

___
Python tracker 

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



[issue33512] use more standard approach for detecting long double in configure

2018-05-14 Thread Eitan Adler

New submission from Eitan Adler :

autotools has a standard macro for defining HAVE_LONG_DOUBLE. Lets use it 
rather than using our own.

--
components: Build
messages: 316615
nosy: eitan.adler
priority: normal
severity: normal
status: open
title: use more standard approach for detecting long double in configure

___
Python tracker 

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



[issue33510] [logging] add JSON log formatter

2018-05-14 Thread Steve R. Hastings

Steve R. Hastings  added the comment:

The solution recommended in the logging cookbook does not do the same thing as 
I have proposed.

I have proposed a logging handler that emits JSON suitable for ingestion by a 
log collection system.  With the JSON formatter, all log events, no matter 
their source, are written completely in JSON.  This includes log events from 
already-written library functions that have no expectation of JSON output.  
Also the JSON formatter writes timestamps in the now-universally-understood 
RFC3339 format, the easiest date format to parse.

The logging cookbook solution is that the user must explicitly write JSON data 
into the message line of each call to the logging code.  This would make some 
or all of the message field into JSON but does not solve the problem of logging 
in JSON; the other fields of the log file would remain non-JSON.

A company that is using a log collection system might need the logs to be pure 
JSON.  The proposed JSON formatter solves that problem.

P.S. Here is a blog posting on why it is useful to log in pure JSON:

https://journal.paul.querna.org/articles/2011/12/26/log-for-machines-in-json/

--

___
Python tracker 

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



[issue29706] IDLE needs syntax highlighting for async and await

2018-05-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

PR 6846 adds the htest line to all versions (no news).  When merged, I will 
augment the keyword list and add a news blurb for 3.6.

--
stage: patch review -> needs patch
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



[issue29706] IDLE needs syntax highlighting for async and await

2018-05-14 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
pull_requests: +6526
stage: test needed -> patch review

___
Python tracker 

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



[issue33511] update.config.sub

2018-05-14 Thread Eitan Adler

Change by Eitan Adler :


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

___
Python tracker 

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



[issue33511] update.config.sub

2018-05-14 Thread Eitan Adler

New submission from Eitan Adler :

confg.sub has been updated upstream. lets pull it in.

--
components: Build
messages: 316612
nosy: eitan.adler
priority: normal
severity: normal
status: open
title: update.config.sub
type: enhancement

___
Python tracker 

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



[issue26264] keyword module missing async and await keywords

2018-05-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This is out-of-date for 3.5 and almost so for 3.6 and not an issue for 3.7.  
The PR has been closed.  And I agree with Raymond that keywords.py should not 
anticipate the future.  All this is aside from the auto-generation issue.

--
nosy: +terry.reedy
resolution: not a bug -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue33479] Document tkinter and threads

2018-05-14 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

> This seems very complicated. The official line on threads for Tk has always 
> been to make all Tk calls from one thread, which is at least predictable and 
> comprehensible. Is there any reason for Tkinter to suggest anything different?

Tcl/Tk doesn't have a notion of a blocking event loop like other GUI toolkits 
do. Any code using Tcl must essentially call Tcl_DoOneEvent/`update` regularly 
at strategic points.
This allows to work completely in one thread -- i.e. even if the OS has no 
threads whatsoever. Tcl/Tk is very old, and this model made perfect sense back 
then (and still does in some scenarios -- e.g. 
https://stackoverflow.com/questions/4083796/how-do-i-run-unittest-on-a-tkinter-app
 -- so there's no point in dropping it).
If we'll be updating tutorials (the reference is a priority though), we 
definitly need to demonstrate this option.

The current best practice for GUI programming is different. There's one "GUI" 
thread that runs just the event loop constantly, and other threads submit 
GUI-related work items into its queue (whatever they are called - "messages", 
"events", "futures"...). Likewise, for any lengthy task, the GUI thread spawns 
worker threads that report back on their progress via the same queue.

All more or less modern GUI toolkits implement and advertize this model as the 
primary one -- as does Tkinter. So, at least the work item submitting API must 
be thread-safe (and in other GUI tooltikts, it is -- see 
https://mail.python.org/pipermail/python-dev/2018-May/153359.html ).
For programmer's convenience, Tkinter does this transparently: whenever and 
whatever Python thread a call is made from, it makes it look for the Tcl 
interpreter as if all calls are sequential, and it enforces correct order for 
interdependent calls.

A great deal of complexity comes from the fact that Tcl's threading model is 
very unothodox. Tcl's team seem to only have accepted threads reluctantly and 
to have been campaigning against threads for years before that 
(https://wiki.tcl.tk/38128 is arguably the most egregious case).
So, what they did is tie a Tcl interpreter to an OS thread (by using thread 
local storage for its data). Long story short, no-one else does it like this 
(at least, I've never seen or heard of anything of the kind), and this is not 
what thread-local storage is meant for 
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4324.html lists some 
use cases for TLS). The best practice is to use locks to ensure orderly access 
to the shared state instead. My guess for the decision is it was the easiest 
way to migrate the code base (yet still tough as https://wiki.tcl.tk/1370 seems 
to hint), and it kinda lines up with that "single thread" mindset.

Tkinter thus has to jump through hoops for calls coming from other threads 
(since for Python, it absolutely doesn't matter which OS thread makes a call).
All the limitations when using threaded Tcl (see the letter attached to the 
ticket for details) come solely from this tying. With nonthreaded Tcl (bugs 
nonwithstanding), it's free-for-all, everything can be called from everywhere. 
The only upside is that with threaded Tcl, calls to different interpreters can 
run in parallel.

> This ignores the compilation issue of course. FYI, the Tcl core group will 
> probably eliminate the possibility of doing non-threaded builds in the 
> future, though with backwards compatibility issues, that's neither here nor 
> there.

I know. Me asking them for clarifications from Tcl/Tk's side seems to have 
triggered it, in fact. Since the sole offender is their threading model, the 
way is to show them how it's defective and work towards improving it. We have 
at least a few years with old versions, and the limitations seem tolerable at 
first glance anyway, so that's not a priority.

> do you know how to identify the tcl/tk build on MacOS or Linux?

The same way Tkinter does @_tkinter.c:624 . The equivalent Python is 
`tkinter.Tk().tk.call("array","get","tcl_platform","threaded")`

--

___
Python tracker 

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



[issue33491] mistype of method's name

2018-05-14 Thread bbayles

bbayles  added the comment:

I think you'll find that your link points to the exception class `SkipTest`, 
which does start with a capital level.

This is distinct from the `skipTest` method of `unittest.TestCase` objects, 
which starts with a lowercase letter.

The documentation looks right to me. See [1] for a demonstration of the 
difference.

[1] https://gist.github.com/bbayles/5158750b48a5accfceaa53a898b8b902

--
nosy: +bbayles

___
Python tracker 

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



[issue33506] [logging] template for filename timestamps

2018-05-14 Thread Steve R. Hastings

Steve R. Hastings  added the comment:

> What about [ BaseRotatingHandler.namer ] which allows you to specify your own 
> naming scheme?

I confess that I overlooked that; it was added later than the version of Python 
in which I wrote my original code.

The current Python code still has a small set of predefined file templates, but 
now has a way to specify a callable that can completely override the filename.  
I agree that this can be used to implement any desired filename system, 
although it would be more work than simply specifying the desired template 
codes.

Are you planning to remove the predefined filename templates and produce a more 
functional version of the code where the .namer() function is always used to 
produce a filename, with a set of predefined functions that produce equivalent 
filenames to the built-in templates?

--

___
Python tracker 

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



[issue33479] Document tkinter and threads

2018-05-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The official line is the claim in the docs that tkinter *is* threadsafe, 
repeated by Martin on at least one issue.  See the first paragraph above.  
Therein lies the problem.

A reason to not just reverse the claim is that it is, at least for practical 
purposes, true, by default, for 8.6.  See the opening post of #11077 for one 
motivation for calling from threads.  (Numerous others have tried and reported 
failures, though usually without explaining why they tried.)

Mark, do you know how to identify the tcl/tk build on MacOS or Linux?  If so, 
and you have installed 3.7.0 on MacOS since b0, which includes 8.6.8, can you 
report which it is?  Ditto for any Linux distribution you have.

--

___
Python tracker 

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



[issue33502] dataclasses: repr of _DataclassParams objects should use repr of each member

2018-05-14 Thread Eric V. Smith

Change by Eric V. Smith :


--
priority: release blocker -> 
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



[issue33479] Document tkinter and threads

2018-05-14 Thread Mark Roseman

Mark Roseman  added the comment:

This seems very complicated. The official line on threads for Tk has always 
been to make all Tk calls from one thread, which is at least predictable and 
comprehensible. Is there any reason for Tkinter to suggest anything different?

This ignores the compilation issue of course. FYI, the Tcl core group will 
probably eliminate the possibility of doing non-threaded builds in the future, 
though with backwards compatibility issues, that's neither here nor there.

--
nosy: +markroseman

___
Python tracker 

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



[issue33502] dataclasses: repr of _DataclassParams objects should use repr of each member

2018-05-14 Thread miss-islington

miss-islington  added the comment:


New changeset b57aeac82ce6ee3d64cef3b6f7e9f9f2d7813f70 by Miss Islington (bot) 
in branch '3.7':
bpo-33502: dataclass._Dataclassparams repr: use repr of each member. (GH-6812)
https://github.com/python/cpython/commit/b57aeac82ce6ee3d64cef3b6f7e9f9f2d7813f70


--
nosy: +miss-islington

___
Python tracker 

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



[issue16865] ctypes arrays >=2GB in length causes exception

2018-05-14 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6524

___
Python tracker 

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



[issue16865] ctypes arrays >=2GB in length causes exception

2018-05-14 Thread miss-islington

Change by miss-islington :


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



[issue16865] ctypes arrays >=2GB in length causes exception

2018-05-14 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 735abadd5bd91db4a9e6f4311969b0afacca0a1a by Serhiy Storchaka 
(Segev Finer) in branch 'master':
bpo-16865: Support arrays >=2GB in ctypes. (GH-3006)
https://github.com/python/cpython/commit/735abadd5bd91db4a9e6f4311969b0afacca0a1a


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-05-14 Thread Ned Deily

Change by Ned Deily :


--
priority: release blocker -> 
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



[issue33510] [logging] add JSON log formatter

2018-05-14 Thread Vinay Sajip

Vinay Sajip  added the comment:

> A "batteries included" JSON log formatter would be a useful enhancement.

See

https://docs.python.org/3/howto/logging-cookbook.html#implementing-structured-logging

I don't propose to implement your suggestion.

You've now logged three enhancement requests where there are recommended 
mechanisms in the cookbook or reference documentation for dealing with the 
situations you describe.

I'm not really minded to implement any of these proposed enhancements, as I 
think the approaches already described in the documentation are adequate.

--

___
Python tracker 

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



[issue33508] [logging] allow %p code to put PID into log filename

2018-05-14 Thread Vinay Sajip

Vinay Sajip  added the comment:

> Python logging is not multi-process safe.

Covered in

https://docs.python.org/3/howto/logging-cookbook.html#logging-to-a-single-file-from-multiple-processes

You can certainly arrange to have the pid in the filename without a change to 
the stdlib. I don't propose to implement this.

--

___
Python tracker 

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



[issue33497] cgi.parse_multipart does not have an associated "errors" parameter with its "encoding" parameter

2018-05-14 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Is 'replace' the good default value? 'strict' is the default value for most 
encoding/decoding operations. 'surrogateescape' is used if the failure and the 
loss of information are not desirable (like in filenames decoding). 
'backslashreplace' is good if we want to avoid a failure, but want to expose 
undecodable bytes in human-readable form.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33506] [logging] template for filename timestamps

2018-05-14 Thread Vinay Sajip

Vinay Sajip  added the comment:

> The logging library has a small set of predefined filename templates and no 
> way is provided to override them.

What about

https://docs.python.org/3/library/logging.handlers.html#logging.handlers.BaseRotatingHandler.namer

which allows you to specify your own naming scheme?

What prevents you from subclassing one of the existing rotating handlers and 
implementing the algorithm you want?

--

___
Python tracker 

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



[issue33497] cgi.parse_multipart does not have an associated "errors" parameter with its "encoding" parameter

2018-05-14 Thread Ned Deily

Ned Deily  added the comment:

Thanks for the report and the PR, @hawkowl!  Merged for 3.7.0rc1.

--
priority: release blocker -> 
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



[issue33497] cgi.parse_multipart does not have an associated "errors" parameter with its "encoding" parameter

2018-05-14 Thread Ned Deily

Ned Deily  added the comment:


New changeset 5195039bb5529f1b18d30e8bfcabdee739912d76 by Ned Deily (Miss 
Islington (bot)) in branch '3.7':
bpo-33497: Add NEWS and ACKS entries. (GH-6838) (GH-6840)
https://github.com/python/cpython/commit/5195039bb5529f1b18d30e8bfcabdee739912d76


--

___
Python tracker 

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



[issue33510] [logging] add JSON log formatter

2018-05-14 Thread Steve R. Hastings

New submission from Steve R. Hastings :

Many logging aggregation and indexing systems require that log data must be 
written in an easy-to-parse format such as JSON.  A "batteries included" JSON 
log formatter would be a useful enhancement.

I have written code with the following features:

Log events are translated into JSON.  The JSON is formatted without 
indentation, so that one log event will produce one line in the output file.  
Each line is a single JSON object.  Because log files contain many lines and 
JSON logging is usually not read by humans, the JSON separator punctuation are 
set to simply ':' and ',' (no leading or trailing spaces).

The standard fields of a log event turn into key/value pairs in the JSON 
object, using the standard field name as the output JSON key name.  For 
example, a log statement like this: log.info("foo initialized") would result in 
JSON that included: "message": "foo initialized", "levelname": "INFO"

By default, the JSON output has the timestamp as the first key/value pair; 
therefore if the file is sorted, or multiple log files are concatenated and 
then sorted, the logged events will be sorted into elapsed order.  By default, 
the timestamp format is RFC3339: https://tools.ietf.org/html/rfc3339  Also, by 
default, the seconds field will have a fractional part with three digits (i.e. 
millisecond resolution on log event timestamps).

The user can provide a dictionary that will translate key names.  If the user's 
log collection system requires the logging level to have a key name of 
"priority", then by specifying that "levelname" should be mapped to "priority" 
the log event will be output with "priority": "INFO"  This dictionary also 
provides a way to control which logging event fields are written to the logfile 
and in what order.

Taking advantage of a feature already present in the Python logging code: The 
user can provide a dictionary as the only argument after the logging message, 
and it will be handled specially.  For the JSON formatter, the special handling 
is that the key/value pairs from the dictionary will be included in the JSON 
output.  Alternatively, the user can provide a message string that includes % 
templating codes, and specify arguments to be templated in, as is common 
practice in logging.  (This is to be backwards-compatible with code written to 
the current formatters.)

The Python logging code feature mentioned above can be found in 
LogRecord.__init__()  The first thing that init code does is check whether 
there is exactly one argument and it is a non-empty Mapping.

In the case where there are multiple arguments provided and templated into the 
message string, one extra key/value pair is written in the JSON object: the key 
is "args" and the value is a JSON array with the values of the arguments.

Because logging is fundamental, if anything goes wrong it's important to log as 
much as possible.  If any exception is raised during the call to json.dumps() 
that creates an output line, there is fallback code that converts the arguments 
dictionary to a string and logs that string under an identifiable key name such 
as "args_text"  So if someone attempts to log arguments that json.dumps() can't 
handle, something will be written to the logfile even if it's just something 
like "<__main__.Foo object at 0x7f8fe7621da0>"


Here is a concrete example.  The JSON logging formatter is initialized with the 
following field name translation table:

TRANSLATE_FIELD_NAMES = {
"asctime": "@timestamp",
"levelname": "priority",
"message": None,
"process": "pid",
}

The above dictionary means that asctime, levelname, message, and process will 
be written to the output file, in that order.  The output JSON object will have 
key names of, respectively: "@timestamp", priority, message (no change), and 
pid.

Then the following logging call occurs:

 log.info("connecting to server", {"url": server_url, "port": sever_port})



The output written to the log file would be similar to this:

{"@timestamp":"2018-05-14T17:28:04.112-04:00","priority":"INFO","message":"connecting
 to server","pid":32073,"url":"http://127.0.0.1","port":8043}


As noted above, I have already written this code, and it has been in production 
for months at the company where I work.  However, the code can be simplified 
and cleaned up a bit, since it contains Python 2.7 backward compatibility code.

--
components: Library (Lib)
messages: 316597
nosy: steveha, vinay.sajip
priority: normal
severity: normal
status: open
title: [logging] add JSON log formatter
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



[issue33497] cgi.parse_multipart does not have an associated "errors" parameter with its "encoding" parameter

2018-05-14 Thread Ned Deily

Ned Deily  added the comment:


New changeset e8f968dcde520160bea7c98d298e58128f9abaa4 by Ned Deily (Miss 
Islington (bot)) in branch '3.7':
bpo-33497: Add errors param to cgi.parse_multipart and make an encoding in 
FieldStorage use the given errors (GH-6804) (GH-6837)
https://github.com/python/cpython/commit/e8f968dcde520160bea7c98d298e58128f9abaa4


--

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-05-14 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

Also this reading may be relevant/interesting:

https://about.gitlab.com/2018/01/23/how-a-fix-in-go-19-sped-up-our-gitaly-service-by-30x/

--

___
Python tracker 

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



[issue33421] Missing documentation for typing.AsyncContextManager

2018-05-14 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6522

___
Python tracker 

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



[issue33497] cgi.parse_multipart does not have an associated "errors" parameter with its "encoding" parameter

2018-05-14 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6521

___
Python tracker 

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



[issue33497] cgi.parse_multipart does not have an associated "errors" parameter with its "encoding" parameter

2018-05-14 Thread Ned Deily

Ned Deily  added the comment:


New changeset d063b84d9ee435e9ae981c18faccaff5562792c3 by Ned Deily in branch 
'master':
bpo-33497: Add NEWS and ACKS entries. (GH-6838)
https://github.com/python/cpython/commit/d063b84d9ee435e9ae981c18faccaff5562792c3


--

___
Python tracker 

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



[issue33497] cgi.parse_multipart does not have an associated "errors" parameter with its "encoding" parameter

2018-05-14 Thread Ned Deily

Change by Ned Deily :


--
pull_requests: +6520

___
Python tracker 

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



[issue33497] cgi.parse_multipart does not have an associated "errors" parameter with its "encoding" parameter

2018-05-14 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6519

___
Python tracker 

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



[issue33497] cgi.parse_multipart does not have an associated "errors" parameter with its "encoding" parameter

2018-05-14 Thread Ned Deily

Ned Deily  added the comment:


New changeset 545c955be997efd6b3827b981024e6b9945d82d1 by Ned Deily (Amber 
Brown) in branch 'master':
bpo-33497: Add errors param to cgi.parse_multipart and make an encoding in 
FieldStorage use the given errors (GH-6804)
https://github.com/python/cpython/commit/545c955be997efd6b3827b981024e6b9945d82d1


--

___
Python tracker 

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



[issue32861] urllib.robotparser: incomplete __str__ methods

2018-05-14 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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



[issue20104] expose posix_spawn(p)

2018-05-14 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

Some interesting benchmarks of posix spawn:

https://github.com/rtomayko/posix-spawn/blob/master/README.md

--
components:  -Library (Lib)
priority: normal -> release blocker
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



[issue32861] urllib.robotparser: incomplete __str__ methods

2018-05-14 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 861d38443d4b85cdc7b87afc4adee55f51c2f4b3 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-32861: robotparser fix incomplete __str__ methods. (GH-5711) 
(GH-6795) (GH-6817)
https://github.com/python/cpython/commit/861d38443d4b85cdc7b87afc4adee55f51c2f4b3


--

___
Python tracker 

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



[issue33505] Optimize asyncio.ensure_future by reordering if conditions

2018-05-14 Thread Jimmy Lai

Change by Jimmy Lai :


--
pull_requests: +6518

___
Python tracker 

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



[issue33346] Syntax error with async generator inside dictionary comprehension

2018-05-14 Thread Guido van Rossum

Guido van Rossum  added the comment:

Is there any problem that is solved by allowing this example? The asymmetry
with using [...async for...] in the same position (which is not allowed)
worries me. Do you have a real use case where it's clearer to write an
async generator expression instead of a nested async function?

def foo():
async def inner():
async for i in ai:
yield i
return inner

I would encourage you to think about various ways of nesting async
generator expressions and comprehensions to see if you can poke a hole in
the design.

--

___
Python tracker 

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



[issue32861] urllib.robotparser: incomplete __str__ methods

2018-05-14 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 3936fd7b2c271f723d1a98fda3ca9c7efd329c04 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
[3.7] bpo-32861: urllib.robotparser fix incomplete __str__ methods. (GH-5711) 
(GH-6795) (GH-6818)
https://github.com/python/cpython/commit/3936fd7b2c271f723d1a98fda3ca9c7efd329c04


--

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-05-14 Thread Gregory P. Smith

Change by Gregory P. Smith :


--
components: +Library (Lib)

___
Python tracker 

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



[issue32731] getpass.getuser() raises an unspecified exceptions (ImportError, OSError, etc)

2018-05-14 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi,

For the wording, I have no suggestions but seems to be fine.

For the rest, I think you have modified the documentation and it's fine and we 
don't talk about the code.

We could merge the PR for the documentation and maybe you could create a new PR 
for the code.

--
nosy: +matrixise

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-05-14 Thread Gregory P. Smith

Change by Gregory P. Smith :


--
priority: release blocker -> normal
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



[issue20104] expose posix_spawn(p)

2018-05-14 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset 8e633a4035bcff458c45fa095f4b8eab2f158466 by Gregory P. Smith 
(Pablo Galindo) in branch '3.7':
bpo-20104: Remove posix_spawn from 3.7 (GH-6794)
https://github.com/python/cpython/commit/8e633a4035bcff458c45fa095f4b8eab2f158466


--

___
Python tracker 

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



[issue33499] Environment variable to set alternate location for pycache tree

2018-05-14 Thread Carl Meyer

Change by Carl Meyer :


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

___
Python tracker 

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



[issue33509] warnings.warn_explicit with module_globals=True raises a SystemError

2018-05-14 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This bug was before commit d4f8480dfe89447587550a85b61d4e9faf827e98.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33483] build system requires explicit compiler, but should discover it

2018-05-14 Thread Eitan Adler

Eitan Adler  added the comment:

On any system where "gcc" is not the correct compiler to use.  If it does not 
exist, is too old, points to the incorrect compiler, etc.

Concretely I have two such systems:
- on one, "gcc" does not exist
- on the other "gcc" is actually a hardlink to "clang"

--

___
Python tracker 

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



[issue33509] warnings.warn_explicit with module_globals=True raises a SystemError

2018-05-14 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue33346] Syntax error with async generator inside dictionary comprehension

2018-05-14 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Did you mean {} for the outer brackets intead of []?

Yes, my bad.

> All of these should only be allowed inside 'async def' though, right?

Yep, except async generator expressions which are allowed to appear in 
synchronous contexts, e.g.:

   def foo():
   return (i async for i in ai)

(this already works in 3.7).

--

___
Python tracker 

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



[issue33499] Environment variable to set alternate location for pycache tree

2018-05-14 Thread Carl Meyer

Carl Meyer  added the comment:

Per vstinner Python prefers to not have underscores in environment variable 
names, for historical reasons. So I'm using `PYTHONBYTECODEPATH` as the env var.

Other open questions: 

1) Does there need to be a corresponding CLI flag, or is env-var-only 
sufficient?

2) Is it OK to check the environ every time, or do we need to cache its value 
in a `sys` flag at startup?

Will push an initial version for review that has no CLI flag nor `sys` 
attribute.

--

___
Python tracker 

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



[issue33505] Optimize asyncio.ensure_future by reordering if conditions

2018-05-14 Thread Jimmy Lai

Change by Jimmy Lai :


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

___
Python tracker 

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



[issue33502] dataclasses: repr of _DataclassParams objects should use repr of each member

2018-05-14 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6514

___
Python tracker 

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



[issue33502] dataclasses: repr of _DataclassParams objects should use repr of each member

2018-05-14 Thread Eric V. Smith

Eric V. Smith  added the comment:


New changeset 3059042410dce69806b94be72d5c8055d616f3a3 by Eric V. Smith in 
branch 'master':
bpo-33502: dataclass._Dataclassparams repr: use repr of each member. (GH-6812)
https://github.com/python/cpython/commit/3059042410dce69806b94be72d5c8055d616f3a3


--

___
Python tracker 

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



[issue33509] warnings.warn_explicit with module_globals=True raises a SystemError

2018-05-14 Thread STINNER Victor

STINNER Victor  added the comment:

I choose the release blocker priority, since IMHO it's an easy fix.

--
nosy: +ned.deily
priority: normal -> release blocker

___
Python tracker 

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



[issue31572] Avoid suppressing all exceptions in PyObject_HasAttr()

2018-05-14 Thread STINNER Victor

STINNER Victor  added the comment:

It seems like this issue caused a regression in _warnings: please see bpo-33509.

--
nosy: +vstinner

___
Python tracker 

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



[issue33509] warnings.warn_explicit with module_globals=True raises a SystemError

2018-05-14 Thread STINNER Victor

STINNER Victor  added the comment:

It may be related to:

commit d4f8480dfe89447587550a85b61d4e9faf827e98
Author: Serhiy Storchaka 
Date:   Sat Nov 11 15:19:47 2017 +0200

bpo-31572: Don't silence unexpected errors in the _warnings module. (#3731)

Get rid of _PyObject_HasAttrId() and PyDict_GetItemString().
Silence only expected AttributeError, KeyError and ImportError when
get an attribute, look up in a dict or import a module.

--
nosy: +vstinner

___
Python tracker 

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



[issue33509] warnings.warn_explicit with module_globals=True raises a SystemError

2018-05-14 Thread Amber Brown

New submission from Amber Brown :

Reproducible with:

import warnings
warnings.warn_explicit("msg", DeprecationWarning, "name", 1, 
module_globals=None)

--
components: Interpreter Core
messages: 316578
nosy: hawkowl
priority: normal
severity: normal
status: open
title: warnings.warn_explicit with module_globals=True raises a SystemError
type: crash
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue33507] Improving the html rendered by cgitb.html

2018-05-14 Thread Stéphane Blondon

Stéphane Blondon  added the comment:

current.png is a screenshot of the html shown in a browser with 3.8 branch
next.png is a screenshot of the modified cgitb.html() function.

--
Added file: https://bugs.python.org/file47589/current.png

___
Python tracker 

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



[issue33508] [logging] allow %p code to put PID into log filename

2018-05-14 Thread Steve R. Hastings

New submission from Steve R. Hastings :

Python logging is not multi-process safe.  When a Python program has multiple 
processes, one way to log safely would be to put the process ID number into the 
filename of the log file, giving each process its own log file.

It would be convenient if a %p format code would be expanded to the process ID 
number when the logging system opens the log file.

--
components: Library (Lib)
messages: 316576
nosy: steveha, vinay.sajip
priority: normal
severity: normal
status: open
title: [logging] allow %p code to put PID into log filename
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



[issue33507] Improving the html rendered by cgitb.html

2018-05-14 Thread Stéphane Blondon

New submission from Stéphane Blondon :

cgitb.html() returns HTML code viewable in a browser.

It would be nice to improve the rendering to have something more readable 
(increase space between each call, increase contrast for the source code) and 
more modern.

You can see the difference in the attached screenshot.

--
components: Library (Lib)
files: next.png
messages: 316575
nosy: sblondon
priority: normal
severity: normal
status: open
title: Improving the html rendered by cgitb.html
type: enhancement
versions: Python 3.8
Added file: https://bugs.python.org/file47588/next.png

___
Python tracker 

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



[issue33506] [logging] template for filename timestamps

2018-05-14 Thread Steve R. Hastings

New submission from Steve R. Hastings :

When a logged file has a timed rotation, it is renamed with an archival 
filename that includes a timestamp.  The logging library has a small set of 
predefined filename templates and no way is provided to override them.

Also, the current rule is that while the file is in active use for logging, it 
will not have a timestamp in the filename; the filename will be something like: 
foo.log

Then, at file rotation time, foo.log is closed and then renamed to an archival 
name that includes a timestamp (something like: foo-2018-05-14.log), and a new 
active log file is opened with the name foo.log again.

Proposed enhancement: it should be possible to provide template codes that 
specify the format of the timestamp, and there should be an option that when 
the file is in active use its filename will include the timestamp.  (Then at 
rotation time, the file is simply closed, with no need to rename it; and a new 
file with a new timestamp is opened.)

For example, specifying a log filename of "foo-%Y%m%d-%H%M%S" would specify a 
filename like: foo-20180514-16.log

Use case: the company that employs me had a logging system requiring both of 
the above features.  The timestamp in the filename had to be in a format 
different than the one format built-in to the logging module, and the timestamp 
needed to be in the file at all times.  The logging system included a daemon 
that did the equivalent of tail -f on the logfile and collected log events as 
they were written.

Note: I have written code that implements the features described above.

Additional note: some template formats could cause a problem with deleting the 
oldest backup files.

When the option backupCount is set to a number >= 1, then at rotation time the 
handler will check whether the number of backup files exceeds the specified 
count, and will delete the oldest files to reduce the number of backup files to 
exactly the backupCount number.

The oldest files are found by sorting the filenames; the presumption is that 
the archival filenames will sort with the oldest files first.  All the built-in 
templates produce filenames where this presumption is correct.  A foolish user 
could specify a timestamp format where month appears before date, or hour 
appears before month, or any other template that does not follow this ordering: 
year/month/date/hour/minutes/seconds

We could also add a feature where, when the template is specified and 
backupCount is specified, the handler will check that the template follows the 
ordering so that the oldest files do sort first, and raise an exception if the 
template doesn't follow the ordering.  Alternatively, we can add a note in the 
documentation warning of this issue.

--
components: Library (Lib)
messages: 316573
nosy: steveha, vinay.sajip
priority: normal
severity: normal
status: open
title: [logging] template for filename timestamps
type: enhancement
versions: Python 3.8

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



[issue31500] IDLE: Tiny font on HiDPI display

2018-05-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

My inclination, then, is to close this issue and PR until there is a 
demonstrated need for change and a test machine to verify the fix for 2.7 and 
8.5.19.

--

___
Python tracker 

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



[issue33505] Optimize asyncio.ensure_future by reordering if conditions

2018-05-14 Thread Jimmy Lai

New submission from Jimmy Lai :

`ensure_future` converts the input as future if it's not already a future.
The condition is the following:

if futures.isfuture(coro_or_future):
...
elif coroutines.iscoroutine(coro_or_future):
...
elif inspect.isawaitable(coro_or_future):
...

In real world, `ensure_future` is mostly called by `run_until_complete` and 
gather with async function call (coroutine) as input.
We should check `iscoroutine` first to make it most efficient.

--
components: asyncio
messages: 316572
nosy: asvetlov, jimmylai, yselivanov
priority: normal
severity: normal
status: open
title: Optimize asyncio.ensure_future by reordering if conditions
type: performance
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32769] Add 'annotations' to the glossary

2018-05-14 Thread Andrés Delfino

Change by Andrés Delfino :


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



[issue32769] Add 'annotations' to the glossary

2018-05-14 Thread Andrés Delfino

Change by Andrés Delfino :


--
pull_requests: +6513

___
Python tracker 

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



[issue33475] Fix converting AST expression to string and optimize parenthesis

2018-05-14 Thread Guido van Rossum

Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue24255] Replace debuglevel-related logic with logging

2018-05-14 Thread Megan Sosey

Megan Sosey  added the comment:

I'm going to work on this one since the original reporter last commented 3 
years ago. I took a quick look at how the other modules are handling logging to 
see if I could make it consistent, and they all do it a bit differently. It 
might be worthwhile considering normalizing logging across the modules at some 
point. I'm working with the python 3.8 currently on master.

--
nosy: +msosey

___
Python tracker 

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



[issue31445] Index out of range in get of message.EmailMessage.get()

2018-05-14 Thread Barbara

Change by Barbara :


--
pull_requests: +6512

___
Python tracker 

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



[issue33440] Possible lazy import opportunities in `pathlib`

2018-05-14 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Personally I support moving imports of rarely used modules into functions that 
need them. But this is against PEP 8 and should be discussed more widely. 
Perhaps this rule should be weaken, we have to state what exceptions are 
permitted.

--

___
Python tracker 

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



[issue27546] Integrate tkinter and asyncio (and async)

2018-05-14 Thread Alex Walters

Change by Alex Walters :


--
nosy: +tritium

___
Python tracker 

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



[issue33483] build system requires explicit compiler, but should discover it

2018-05-14 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Do you have an example where your patch will work and not the current 
configure.ac. Thank you.

--
nosy: +matrixise

___
Python tracker 

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



[issue32769] Add 'annotations' to the glossary

2018-05-14 Thread Andrés Delfino

Andrés Delfino  added the comment:

I see a conflict here in that annotations can be used for other purpouses, for 
example variable annotations, they are heavily intended for type hinting (PEP 
526 says "This PEP aims at adding syntax to Python for annotating the types of 
variables (including class variables and instance variables), instead of 
expressing them through comments")

I think it's correct to separate annotations from type hints, and say: 
annotations can be used for type hinting.

I can make a new PR based on master having this in mind, and then cherry 
picking it for 3.7/3.6.

--

___
Python tracker 

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



[issue33440] Possible lazy import opportunities in `pathlib`

2018-05-14 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Did you mean the idea about module-level alias to dirname(__file__)? I think 
this is a dead horse. See issue33277.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33462] reversible dict

2018-05-14 Thread Roundup Robot

Change by Roundup Robot :


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

___
Python tracker 

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



[issue32769] Add 'annotations' to the glossary

2018-05-14 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

> ... but annotations are a slightly more general concept because they may be 
> used for other purposes than to indicate the type of a variable ...

Yes, I agree.

--

___
Python tracker 

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



[issue31445] Index out of range in get of message.EmailMessage.get()

2018-05-14 Thread Randy Wong

Randy Wong  added the comment:

Submitted pull request: 
fix-issue-31455: Changed by adding two lines in the module 
"email/_header_value_parser.py" into the function "get_mailbox_list(value)" 
before return mailbox_list, value to avoid IndexError.

--
keywords: +patch
nosy: +radar383
pull_requests: +6510
stage:  -> patch review

___
Python tracker 

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



[issue32769] Add 'annotations' to the glossary

2018-05-14 Thread Guido van Rossum

Guido van Rossum  added the comment:

Before we backport this to 3.7 and 3.6, let's iterate on the wording a bit.

I don't think the distinction between annotations and type hints is that 
annotations are materialized at runtime while type hints aren't. I think 
syntactically they are the same, but annotations are a slightly more general 
concept because they may be used for other purposes than to indicate the type 
of a variable (or argument, attribute etc.).

So IMO in

  def f():
  x: int

'int' is both an annotation and a type hint, OTOH in

  x: 'spam eggs ham'

we have an annotation that is not a type hint.

--

___
Python tracker 

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



[issue18022] Inconsistency between quopri.decodestring() and email.quoprimime.decode()

2018-05-14 Thread R. David Murray

R. David Murray  added the comment:

OK, I've finally gotten around to looking at this.   It looks like quopri and 
binascii are not stripping trailing whitespace.

  quoprimime  binascii quopri   preferred

 b'=' ''  b''  b'=' '='
 b'= '''  b'= 'b'= ''='
 b'= \n'  ''  b'= \n'  b''quoprimime  binascii  
quopri

 b'='  ''  b''   b'='
 b'= ' ''  b'= ' b'= '
 b'= \n'   ''  b'= \n'   b''
 b'=\r'''  b''   b'=\r'
 b'==41'   '=A'b'=41'b'=41''=\n'
 b'=\r'   ''  b''  b'=\r'   '=\r'
 b'==41'  '=A'b'=41'   b'=41'   '=A'
 b'= \n f\n'  ' f\n'  b'= \n f\n'  b'= \n f\n'  ' f\n'

The RFC recommends that a trailing = be preserved, but that trailing whitespace 
be ignored.  It doesn't speak directly to the ==41 case, but one can infer that 
the first = in the == pair is most likely to have "come from the source text" 
and not been encoded, while the =41 was an intentional encoding and so should 
be decoded.

Now, that said, the actual behavior that our libraries have had for a long time 
is to treat the "last line" just like all other lines, and strip a trailing =.  
So I would be inclined to keep that behavior for backward compatibility reasons 
rather than change it to be more RFC compliant, given that we don't have any 
actual bug report related to it, and "fixing" it could break things.  Given 
that, the current quoprimime behavior becomes the reference.

However, backward compatibility concerns also arise around starting to strip 
trailing space in quopri and binascii. Maybe we only make that change in 3.8?

--

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2018-05-14 Thread Terry Thurk

Change by Terry Thurk :


--
pull_requests: +6509
stage:  -> patch review

___
Python tracker 

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



[issue32769] Add 'annotations' to the glossary

2018-05-14 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

Yes, all this also applies to 3.6.

--

___
Python tracker 

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



[issue33346] Syntax error with async generator inside dictionary comprehension

2018-05-14 Thread Guido van Rossum

Guido van Rossum  added the comment:

> [f: [x async for x in f(x)] for f in fs]

Did you mean {} for the outer brackets intead of []?

I think it is reasonable that if the presence of 'async for' or 'await' in a 
comprehension makes it async, then this should also apply if that comprehension 
is nested inside another.

All of these should only be allowed inside 'async def' though, right?

--

___
Python tracker 

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



[issue33465] test_from_import_missing_attr_has_name_and_so_path fails when select is a builtin instead of an extension

2018-05-14 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I think that in any case this test should be marked as CPython-only.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33421] Missing documentation for typing.AsyncContextManager

2018-05-14 Thread Travis DePrato

Change by Travis DePrato :


--
pull_requests: +6507

___
Python tracker 

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



[issue33421] Missing documentation for typing.AsyncContextManager

2018-05-14 Thread Travis DePrato

Change by Travis DePrato :


--
pull_requests: +6508

___
Python tracker 

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



[issue32769] Add 'annotations' to the glossary

2018-05-14 Thread Andrés Delfino

Andrés Delfino  added the comment:

Shouldn't we have this on 3.6 also?

--

___
Python tracker 

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



[issue32769] Add 'annotations' to the glossary

2018-05-14 Thread Andrés Delfino

Change by Andrés Delfino :


--
pull_requests: +6506

___
Python tracker 

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



[issue32769] Add 'annotations' to the glossary

2018-05-14 Thread Andrés Delfino

Andrés Delfino  added the comment:

Yes, Ivan, I was thinking about that.

I think it makes sense, and I'll be glad to do it.

--

___
Python tracker 

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



  1   2   3   >