[issue37119] Equality on dict.values() are inconsistent between 2 and 3

2019-05-31 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

https://docs.python.org/3/library/stdtypes.html#dictionary-view-objects

> Keys views are set-like since their entries are unique and hashable. If all 
> values are hashable, so that (key, value) pairs are unique and hashable, then 
> the items view is also set-like. (Values views are not treated as set-like 
> since the entries are generally not unique.) For set-like views, all of the 
> operations defined for the abstract base class collections.abc.Set are 
> available (for example, ==, <, or ^).

In Python 2 keys() and values() return a list where __eq__ is implemented. In 
Python 3 view objects are returned. This can be seen in Python 2 also using 
viewkeys and viewvalues where viewvalues() is False. So this is not a bug but I 
am not sure if docs can be improved to clarify this further.


$ python2
Python 2.7.14 (default, Mar 12 2018, 13:54:56)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = {'a': 1}
>>> b = {'a': 1}
>>> a.viewkeys() == b.viewkeys()
True
>>> a.viewvalues() == b.viewvalues()
False
>>> a.values() == b.values()
True

--
nosy: +rhettinger, xtreak

___
Python tracker 

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



[issue36411] Python 3 f.tell() gets out of sync with file pointer in binary append+read mode

2019-05-31 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


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

___
Python tracker 

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



[issue37120] Provide knobs to disable session ticket generation on TLS 1.3

2019-05-31 Thread Nathaniel Smith

New submission from Nathaniel Smith :

Maybe we should expose the SSL_CTX_set_num_tickets function:

https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_num_tickets.html

This is a new function added in OpenSSL 1.1.1, that lets you control the number 
of tickets issued by a TLS 1.3 connection.

It turns out that by default, openssl 1.1.1 issues 2 tickets at the end of the 
server handshake. In principle this can cause deadlocks and data corruption:

  https://github.com/openssl/openssl/issues/7967
  https://github.com/openssl/openssl/issues/7948

And my problem specifically is that this pretty much kills all of Trio's fancy 
protocol testing helpers, because any protocol that's built on top of TLS is 
automatically broken as far as the helpers are concerned. And they're right. 
Right now I have to disable TLS 1.3 entirely to get Trio's test suite to avoid 
deadlocking.

Hopefully the openssl devs will fix this, but so far their latest comment is 
that they consider this a feature and so they think it has to stay broken for 
at least RHEL 8's lifetime.

Currently the only workaround is to either disable TLS 1.3, or disable tickets. 
But the 'ssl' module doesn't expose any way to control tickets. This issue 
proposes to add that.

Fortunately, exposing SSL_CTX_set_num_tickets should be pretty trivial, at 
least in theory.

Questions:

Do we have a preferred convention for how to expose these kinds of settings at 
the Python level? Attribute on SSLContext?

There's both an SSL* and a SSL_CTX* – I guess the CTX version is sufficient, or 
is there another convention?

As a bonus complication, openssl sometimes ignores the configured number of 
tickets, and uses a completely different mechanism:

> The default number of tickets is 2; the default number of tickets sent 
> following a resumption handshake is 1 but this cannot be changed using these 
> functions. The number of tickets following a resumption handshake can be 
> reduced to 0 using custom session ticket callbacks (see 
> https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_session_ticket_cb.html)

Do we want to open the can-of-worms involved in wrapping this too? I think if 
we only wrapped SSL_CTX_set_num_tickets then that would be enough to let me 
kluge my tests into passing and pretend that things are just fine, so long as 
we don't test session resumption...

--
assignee: christian.heimes
components: SSL
messages: 344148
nosy: alex, christian.heimes, dstufft, janssen, njs
priority: normal
severity: normal
status: open
title: Provide knobs to disable session ticket generation on TLS 1.3
type: enhancement
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2019-05-31 Thread Berker Peksag


Change by Berker Peksag :


--
pull_requests: +13603
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/13716

___
Python tracker 

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



[issue37073] clarify functions docs in IO modules and Bytes Objects

2019-05-31 Thread Windson Yang


Change by Windson Yang :


--
pull_requests: +13602
pull_request: https://github.com/python/cpython/pull/13715

___
Python tracker 

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



[issue36818] Add PyInterpreterState.runtime.

2019-05-31 Thread Eric Snow


Change by Eric Snow :


--
resolution: rejected -> fixed

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-05-31 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +13601
pull_request: https://github.com/python/cpython/pull/13714

___
Python tracker 

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



[issue37073] clarify functions docs in IO modules and Bytes Objects

2019-05-31 Thread Windson Yang


Change by Windson Yang :


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

___
Python tracker 

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



[issue37073] clarify functions docs in IO modules and Bytes Objects

2019-05-31 Thread Windson Yang


Windson Yang  added the comment:

Sure. Feel free to edit my PR.

--

___
Python tracker 

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



[issue29984] Improve test coverage for 'heapq' module

2019-05-31 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 664fe3996f7e05ae351526f02b21504bb065bcf8 by Raymond Hettinger 
(Rob Day) in branch 'master':
bpo-29984: Improve 'heapq' test coverage (GH-992)
https://github.com/python/cpython/commit/664fe3996f7e05ae351526f02b21504bb065bcf8


--

___
Python tracker 

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



[issue37119] Equality on dict.values() are inconsistent between 2 and 3

2019-05-31 Thread 林自均

New submission from 林自均 :

When I create 2 different dicts with the same literal, their dict.values() are 
equal in python2 but not equal in python3.

Here is an example in python2:

$ python2
Python 2.7.16 (default, Mar  4 2019, 09:02:22)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = {'hello': 'world'}
>>> b = {'hello': 'world'}
>>> a.values() == b.values()
True
>>> a.keys() == b.keys()
True

However, the dict.values() are not equal in python3:

$ python3
Python 3.7.2 (default, Feb 12 2019, 08:16:38)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = {'hello': 'world'}
>>> b = {'hello': 'world'}
>>> a.values() == b.values()
False
>>> a.keys() == b.keys()
True

Is this a bug? Or is this behavior specified somewhere in the documentation? 
Thanks.

Note: it's inspired by this StackOverflow question: 
https://stackoverflow.com/questions/56403613/questions-about-python-dictionary-equality

--
components: Library (Lib)
messages: 344145
nosy: johnlinp
priority: normal
severity: normal
status: open
title: Equality on dict.values() are inconsistent between 2 and 3
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue34763] Python lacks 0x4E17

2019-05-31 Thread Berker Peksag


Berker Peksag  added the comment:

Tools/unicode/makeunicodedata.py looks at Unihan database for the fields 
kAccountingNumeric, kOtherNumeric, and kPrimaryNumeric in 
Unihan_NumericValues.txt:


https://github.com/python/cpython/blob/549e55a3086d04c13da9b6f33214f6399681292a/Tools/unicode/makeunicodedata.py#L1107-L1119

And as of Unicode version 12.0.0, 0x4E17 isn't listed as numeric there:

...
U+4E00  kPrimaryNumeric 1
U+4E03  kPrimaryNumeric 7
U+4E07  kPrimaryNumeric 1
U+4E09  kPrimaryNumeric 3
...

Is there another way to get this information by using one of the fields shown at

http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=4E17

--
nosy: +berker.peksag
versions: +Python 3.9 -Python 3.7

___
Python tracker 

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



[issue17005] Add a topological sort algorithm

2019-05-31 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Unless Łukasz gives us a nod to work out this API for the second beta, we'll 
need to defer this to 3.9.   IMO, the API in the patch is not user friendly.  
It started on the right path but became contorted (for both inputs and outputs) 
to serve unusual cases.

--
nosy: +lukasz.langa

___
Python tracker 

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



[issue35996] Optional modulus argument for new math.prod() function

2019-05-31 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue36818] Add PyInterpreterState.runtime.

2019-05-31 Thread Eric Snow


Eric Snow  added the comment:


New changeset 396e0a8d9dc65453cb9d53500d0a620602656cfe by Eric Snow in branch 
'master':
bpo-36818: Add PyInterpreterState.runtime field. (gh-13129)
https://github.com/python/cpython/commit/396e0a8d9dc65453cb9d53500d0a620602656cfe


--

___
Python tracker 

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



[issue37029] PyObject_Free is O(N) where N = # of arenas

2019-05-31 Thread Tim Peters


Change by Tim Peters :


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



[issue37029] PyObject_Free is O(N) where N = # of arenas

2019-05-31 Thread Tim Peters


Tim Peters  added the comment:


New changeset 1c263e39c4ed28225a7dc8ca1f24953225ac48ca by Tim Peters in branch 
'master':
bpo-37029:  keep usable_arenas in sorted order without searching (#13612)
https://github.com/python/cpython/commit/1c263e39c4ed28225a7dc8ca1f24953225ac48ca


--

___
Python tracker 

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



[issue12202] Check status returns in msilib.SummaryInformation.GetProperty()

2019-05-31 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +13599
pull_request: https://github.com/python/cpython/pull/13712

___
Python tracker 

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



[issue12202] Check status returns in msilib.SummaryInformation.GetProperty()

2019-05-31 Thread Berker Peksag


Change by Berker Peksag :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 2.7, Python 3.7

___
Python tracker 

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



[issue12202] Check status returns in msilib.SummaryInformation.GetProperty()

2019-05-31 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 549e55a3086d04c13da9b6f33214f6399681292a by Berker Peksag 
(Zackery Spytz) in branch 'master':
bpo-12202: Properly check MsiSummaryInfoGetProperty() calls in msilib (GH-13711)
https://github.com/python/cpython/commit/549e55a3086d04c13da9b6f33214f6399681292a


--

___
Python tracker 

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



[issue37110] Clarify hashability of custom class instances

2019-05-31 Thread Christoph Zwerschke


Christoph Zwerschke  added the comment:

My point was that it's not immediately obvious what "by default" means and that 
hashability is not only affected by the __hash__ method but also by __eq__.

But I agree, you can argue that "by default" already includes not adding any 
special methods like __eq__ and the glossary should not become too verbose. (I 
remember these words from Donald Knuth in one of his books: "In the interest of 
conciseness, you need to indulge in simplifications that are really little 
lies; these should be overlooked.")

--

___
Python tracker 

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



Re: Checking refusal of a network connection

2019-05-31 Thread Cameron Simpson

On 31May2019 17:35, Markus Elfring  wrote:

I can start a service as desired.

elfring@Sonne:~/Projekte/Bau/C++/test-statistic-server1/local> 
./test-statistic-server2 & /usr/bin/ss -t -l -p -H|grep test
[1] 8961
waiting for connections
server_id: localhost
server_port: 35529
LISTEN 0   123  [::1]:35529  [::]:*  
users:(("test-statistic-",pid=8961,fd=3))
elfring@Sonne:~/Projekte/Bau/C++/test-statistic-server1/local> 0 connections 
were handled.


But I wonder about the following error message then.

elfring@Sonne:~/Projekte/Python> /usr/bin/python3 
~/Projekte/Python/socket-send_json_data.py --server_id localhost 
--server_port 35529

Using Python version:
3.7.2 …
Traceback …:
…
 File "/home/elfring/Projekte/Python/socket-send_json_data.py", line 17, in 
send_data
   so.connect((args.server_id, args.server_port))
ConnectionRefusedError: [Errno 111] Connection refused

How should this inter-process communication difficulty be resolved?


It looks like the service isn't listening at the time the so.connect is 
called. Are you doing it before the service is ready?


Otherwise you need to print out the server_id and port, and examine the 
system to see if that address/port is in LISTEN state. Running "netstat 
-an" on the system running the service is a useful way to do this.


Hmm, look like your "ss" command effectively does that.

I'd fall back to the connect then: check that it really is using the 
correct address/port. Print them out.


Also, it can be very useful to strace the client process, eg:

 strace -e trace=network /usr/bin/python3 
~/Projekte/Python/socket-send_json_data.py --server_id localhost --server_port 
35529

You can also strace the running service process:

 strace -e trace=network -p pid-of-service-process-here

to see if it is responding in any way to the client connect.

Also, on the service side it isn't enough to create the service socket, 
you also need to do an accept IIRC. If you're using Python's socket 
library the service classes do that for you.


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


Re: How to use ssh-agent in windows in python?

2019-05-31 Thread Cameron Simpson

On 31May2019 21:51, Fc Zwtyds  wrote:

在 2019-05-30 6:41, Cameron Simpson 写道:
The you could just use os.system() to run the other commands, because 
the environment now has the necessary environment settings.

[...]


 Under your guidance, the python code using ssh-agent ssh-add has 
been running successfully. In addition to the code you wrote to me, I 
also refer to man ssh-agent and subprocess: Subprocess management. I 
now know the importance of environment variables.


Excellent. I'm glad to hear it.


BTW, this program is for visit youtube.


I am curious, how do you use the ssh commands to access youtube? I 
though it was an HTTP only service.


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


[issue37110] Clarify hashability of custom class instances

2019-05-31 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The docs look correct to me:

>>> class A:
pass

>>> hash(A())
274859987

User defined classes are in-fact hashable by default.  Other methods can be 
defined to change hashability, but they are not the default.

FWIW, it isn't the purpose of the glossary to be a language spec; rather, it is 
to provide a rough meaning of what the word "hashable" means.  Already, the 
wording has exceeded its original intent.  The correct place for a more 
detailed specification in the language reference for object.__hash__():

   
https://docs.python.org/3/reference/datamodel.html?highlight=__hash__#object.__hash__

Thank you for the suggestion, but we'll pass on this one.

--
assignee: docs@python -> rhettinger
nosy: +rhettinger
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue32628] Add configurable DirectoryIndex to http.server

2019-05-31 Thread Erik Paulson


Erik Paulson  added the comment:

I think my use case was Sharepoint and static site generators - Sharepoint can 
serve a tree of .aspx files as raw HTML, but maddeningly not .html files. The 
site generator we used spit out a fairly complicated site where the internal 
links point at directories counting on the fact that it is served correctly by 
the directoryindex handler. The site generator spits out .aspx but http.server 
can't serve them. 

A directory full of .xhtml files would have similar problems, which certainly 
still exist in the wild. 

The example in the test was named index.test because it's creating files on the 
disk in the test, shared by other parts of the test, and I wanted to be clear 
about what it was. It was not intended to be an example use case.

--

___
Python tracker 

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



[issue12639] msilib Directory.start_component() fails if keyfile is not None

2019-05-31 Thread Steve Dower


Steve Dower  added the comment:


New changeset bfc1f605609218b9734d3cf3eab3531a2f4624e1 by Steve Dower (Miss 
Islington (bot)) in branch '2.7':
[2.7] bpo-12639: msilib.Directory.start_component() fails if *keyfile* is not 
None (GH-13688)
https://github.com/python/cpython/commit/bfc1f605609218b9734d3cf3eab3531a2f4624e1


--

___
Python tracker 

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



[issue12639] msilib Directory.start_component() fails if keyfile is not None

2019-05-31 Thread Steve Dower


Change by Steve Dower :


--
resolution:  -> fixed
stage: backport needed -> 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



[issue37117] Simplify customization of the logging time through datefmt

2019-05-31 Thread Mario Corchero


Mario Corchero  added the comment:

AFAIK, the converter attribute is only to "be set" with a function of such 
signature. It is not documented that it can be used and it is only used on the 
format time function.

The only situation where this might break someone is if they inherit from 
formatter, substitute the formatTime function by their own implementation and 
rely on the function returning a time tuple. Doing that is relying on the 
implementation of the formatter though, as the docs explain is just something 
to be set.

This could be released as part of a new Python version, I'd be surprised if 
this is an issue and it will improve quite nicely the way users can configure 
the formatting of timestamps.

Even if adding it to the cookbook would "work" I think it would be much better 
to have this change and provide a nicer experience with the default class.

This is your call though! But I'd say it would be quite a nice improvement, was 
speaking with some other devs at PyCon and they seemed quite excited.

--

___
Python tracker 

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



[issue36896] clarify in types.rst that FunctionTypes & co constructors don't have stable signature

2019-05-31 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Yes, I think " Not for the faint of heart." could be replaced or augmented by 
'api may change'

--

___
Python tracker 

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



[issue37089] `import Lib.os` works on windows (but shouldn't)

2019-05-31 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

If .../Tools and its subdirectories had __init__.py files, the presence of 
sys.prefix on sys.path, on Windows, would allow imports from those subdirs.  
Otherwise, it only provides a second way to import stdlib modules.  This seems 
like a bit of a bug.  Guido, do you remember why we have this Windows-only 
feature?

--
nosy: +gvanrossum, terry.reedy

___
Python tracker 

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



[issue12202] Check status returns in msilib.SummaryInformation.GetProperty()

2019-05-31 Thread Zackery Spytz


Zackery Spytz  added the comment:

This issue needs to be fixed. Passing an invalid value to 
SummaryInformation.GetProperty() will cause the first 
MsiSummaryInfoGetProperty() call to fail. As the call is not properly checked, 
the "type" variable will then be used uninitialized in summary_getproperty().

--
nosy: +ZackerySpytz
type:  -> behavior
versions: +Python 2.7, 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



[issue12202] Check status returns in msilib.SummaryInformation.GetProperty()

2019-05-31 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +13598
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/13711

___
Python tracker 

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



[issue37082] Assignment expression symbol (walrus) not in built-in help()

2019-05-31 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The augmented assignment symbol, like that for plain assignment, is not, 
properly speaking, an operator.  But it definitely is a symbol that needs to be 
documented.

1. Generally update the help symbol list.

2. Document :=, assignment expression, in the regular docs, but I found nothing.

':=' should be on https://docs.python.org/3.8/genindex-Symbols.html just 
':(colon)'.

'expression' should be listed under 'assignment on
https://docs.python.org/3.8/genindex-A.html

I think 'assignment' should be listed under 'expression' on
https://docs.python.org/3.8/genindex-E.html

I could not find anything in the expressions chapter.

--
nosy: +terry.reedy
title: Assignment expression operator (walrus) not in built-in help() -> 
Assignment expression symbol (walrus) not in built-in help()

___
Python tracker 

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



[issue37101] Filterer.filter can be rewritten using built-ins just as efficient much more readable

2019-05-31 Thread Dale Visser


Dale Visser  added the comment:

FWIW, when I tried this instead, I got 21 to 22 msec per 1000 log messages 
(still a 5-10% performance hit):

def filter(self, record):
rv = True
if self.filters:
rv = all(getattr(f, 'filter', f)(record) for f in self.filters)
return rv

I don't see that getattr(...) should be less efficient than hasattr(...), so 
the generator expression is the likely culprit.

--

___
Python tracker 

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



[issue32628] Add configurable DirectoryIndex to http.server

2019-05-31 Thread Berker Peksag


Berker Peksag  added the comment:

Thank you for the report and for the patch!

What's your use case? I understand the need for it for httpd, but as someone 
who uses http.server daily, I can't think of a use case that I'd find this 
feature useful. Note that even the example in your message and the test in the 
patch use artificial file names :)

Handler.directory_index.append("index.htmlx") API doesn't look good to me. It 
would be nice to subclass it, but that would make http.server less usable 
(especially if you run it via "python -m http.server")

I suggest closing this as 'rejected' (sorry!)

--
nosy: +berker.peksag

___
Python tracker 

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



[issue37102] Automatically dedent docstring constants by default

2019-05-31 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi, I'm working on a PR. It should be ready in a couple of days. It's more 
involved than what I thought as to avoid importing inspect during compilation I 
will probably need to port cleandoc() in C.

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue37080] Cannot compile Python3.7.3 on Alt-F (ARM)

2019-05-31 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I presume you are trying to compile CPython.  Perhaps you might do better with 
MicroPython, designed for micro devices.  Steve, do you know anything about 
CPython on Arm with linux?

--
nosy: +steve.dower, terry.reedy

___
Python tracker 

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



[issue37073] clarify functions docs in IO modules and Bytes Objects

2019-05-31 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Can you prepare a PR?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue37071] HTMLParser mistakenly inventing new tags while parsing

2019-05-31 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Please verify with 3.7.3+ and the latest version of Sphinx.  Even if there is a 
problem, Sphinx is not an stdlib package.  The problem would only be relevant 
to this tracker, rather than the Sphinx tracker, if it were due to our 
customizations or use of Sphinx.

--
nosy: +terry.reedy
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue37118] Why is GIL on 2.7 so much faster than 3.7

2019-05-31 Thread gary*atlanta


gary*atlanta  added the comment:

tested this loop:

for (i=0; i performance

___
Python tracker 

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



[issue37068] Emit SyntaxWarning for f-strings without expressions ?

2019-05-31 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

An f-string is equivalent to a format string and call. The exact details are 
not important.

An field with no value is an error either way.  (I prefer the compile-time 
exception.)
>>> f'{}a'
SyntaxError: f-string: empty expression not allowed
>>> '{}a'.format()
Traceback (most recent call last):
  File "", line 1, in 
'{}a'.format()
IndexError: tuple index out of range

>>> 'abc'.format()
'abc'
>>> f'abc'
'abc'

I agree that neither needs a warning.  I actually think the useless call is 
worse than the unneeded prefix.

SyntaxWarnings are rare.  Invalid escapes are now errors.
>>> '\o'
SyntaxError: invalid escape sequence \o

--
nosy: +terry.reedy
resolution:  -> rejected
stage:  -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue37102] Automatically dedent docstring constants by default

2019-05-31 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal

___
Python tracker 

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



[issue37118] Why is GIL on 2.7 so much faster than 3.7

2019-05-31 Thread Zachary Ware


New submission from Zachary Ware :

This is a bug tracker, not a forum for questions.  Please try a more 
appropriate venue for your question, like python-l...@python.org or 
StackOverflow.  You're going to need to provide some actual evidence rather 
than just a provocative assertion, though.

--
nosy: +zach.ware
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
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



[issue12178] csv writer doesn't escape escapechar

2019-05-31 Thread Berker Peksag


Change by Berker Peksag :


--
pull_requests: +13597
pull_request: https://github.com/python/cpython/pull/13710

___
Python tracker 

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



[issue37118] Why is GIL on 2.7 so much faster than 3.7

2019-05-31 Thread gary*atlanta


Change by gary*atlanta :


--
components: Interpreter Core
nosy: gary*atlanta
priority: normal
severity: normal
status: open
title: Why is GIL on 2.7 so much faster than 3.7
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



[issue37105] Add deprecated-remove information on stream doc

2019-05-31 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset ed9f3562b637a59b9000abbceee5ae369d35444d by Andrew Svetlov 
(Emmanuel Arias) in branch 'master':
bpo-37105: Add deprecated-remove information on stream doc (#13672)
https://github.com/python/cpython/commit/ed9f3562b637a59b9000abbceee5ae369d35444d


--
nosy: +asvetlov

___
Python tracker 

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



[issue37040] checking for membership in itertools.count enters infinite loop with no way to exit

2019-05-31 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Dan, please leave this closed.  It duplicates #31815 and should be closed on 
that grounds alone, regardless of the status of the latter.  #31815 was closed 
in favor of #33939, which is open, with ongoing discussion.  Resolution either 
way is blocked because different core developers disagree.

--
nosy: +terry.reedy
resolution:  -> duplicate
status: open -> closed
superseder:  -> Make itertools iterators interruptible

___
Python tracker 

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



[issue15115] Duplicated Content-Transfer-Encoding header when applying email.encoders

2019-05-31 Thread miss-islington


miss-islington  added the comment:


New changeset 464c1ec65af2c1c1d849d50d9726fa453804e70e by Miss Islington (bot) 
in branch '3.7':
bpo-15115: Document deprecation of email.encoders in Python 3 (GH-5354)
https://github.com/python/cpython/commit/464c1ec65af2c1c1d849d50d9726fa453804e70e


--
nosy: +miss-islington

___
Python tracker 

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



[issue11871] test_default_timeout() of test_threading.BarrierTests failure: BrokenBarrierError

2019-05-31 Thread Ivan Pozdeev


Ivan Pozdeev  added the comment:

Got this issue today in AppVeyor's PR check: 
https://ci.appveyor.com/project/python/cpython/builds/24945165, so it's not 
local to David's worker.
(At rerun, the test succeeeded, so the check status was not affected.)

--
nosy: +Ivan.Pozdeev
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue15115] Duplicated Content-Transfer-Encoding header when applying email.encoders

2019-05-31 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8 -Python 2.7, Python 3.6

___
Python tracker 

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



[issue15115] Duplicated Content-Transfer-Encoding header when applying email.encoders

2019-05-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13596
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/13709

___
Python tracker 

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



[issue15115] Duplicated Content-Transfer-Encoding header when applying email.encoders

2019-05-31 Thread Cheryl Sabella


Cheryl Sabella  added the comment:


New changeset a747c3a5edf21fa5670bc30f5e1d804de89ebf62 by Cheryl Sabella in 
branch 'master':
bpo-15115: Document deprecation of email.encoders in Python 3 (GH-5354)
https://github.com/python/cpython/commit/a747c3a5edf21fa5670bc30f5e1d804de89ebf62


--

___
Python tracker 

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



[issue37102] Automatically dedent docstring constants by default

2019-05-31 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


--
nosy: +mbussonn

___
Python tracker 

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



[issue33361] readline() + seek() on codecs.EncodedFile breaks next readline()

2019-05-31 Thread Berker Peksag


Berker Peksag  added the comment:

Thank you for the report, Diego and thank you for the patch, Ammar!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue33361] readline() + seek() on codecs.EncodedFile breaks next readline()

2019-05-31 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset a6dc5d4e1c9ef465dc1f1ad95c382aa8e32b178f by Berker Peksag (Miss 
Islington (bot)) in branch '3.7':
bpo-33361: Fix bug with seeking in StreamRecoders (GH-8278)
https://github.com/python/cpython/commit/a6dc5d4e1c9ef465dc1f1ad95c382aa8e32b178f


--

___
Python tracker 

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



[issue36896] clarify in types.rst that FunctionTypes & co constructors don't have stable signature

2019-05-31 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

>  I don't believe we put version changed notes in docstrings,

Oh no I was thinking a note in the docstring "constructor signature may change 
between Python versions".

Whether to put changed/addition info in docstrings is another subject and a 
thing I would be in favor of; but let's not digress and the current issue which 
is to convey to users the non-stability of interface.

--

___
Python tracker 

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



[issue37111] Logging - Inconsistent behaviour when handling unicode

2019-05-31 Thread Jonathan


Jonathan  added the comment:

> Did you look at the basicConfig documentation before raising this issue?

This seems like an attempt at victim blaming. But yes, I did. In fact, this is 
now the third time I've looked at that page - once before raising this issue, 
once before my previous reply, and now. I note that your example and nothing 
like your example is anywhere on that page. The word "encoding" doesn't appear 
anywhere on the page either. Sure "stream" is on there, but then you need to 
know about streams and make the association with logging which I apparently 
don't. You have to remember not everyone has your level of proficiency in the 
language. In fact, most Python users don't.

Lets put this another way - is there a reason NOT to have Unicode logging as 
the default? Clearly Unicode was important enough for Guido-et-al to decide to 
throw Python 2 under the bus.
I've listed the advantages of changing it, what are the disadvantages?

--

___
Python tracker 

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



[issue36896] clarify in types.rst that FunctionTypes & co constructors don't have stable signature

2019-05-31 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Pablo, I am all for respectfully preserving implementation freedom where we 
can.  From idlelib.__init__: [idlelib files other than idle*.*]  "are private 
implementations.  Their details are subject to change.  See PEP 434 for more.  
Import them at your own risk."

Matthias: I don't believe we put version changed notes in docstrings, as they 
are for the current code.  But if a docstring covers arguments, as usual, then 
the new one should be added.

--

___
Python tracker 

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



[issue33361] readline() + seek() on codecs.EncodedFile breaks next readline()

2019-05-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13595
pull_request: https://github.com/python/cpython/pull/13708

___
Python tracker 

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



[issue33361] readline() + seek() on codecs.EncodedFile breaks next readline()

2019-05-31 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset a6ec1ce1ac05b1258931422e96eac215b6a05459 by Berker Peksag (Ammar 
Askar) in branch 'master':
bpo-33361: Fix bug with seeking in StreamRecoders (GH-8278)
https://github.com/python/cpython/commit/a6ec1ce1ac05b1258931422e96eac215b6a05459


--
nosy: +berker.peksag

___
Python tracker 

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



[issue37111] Logging - Inconsistent behaviour when handling unicode

2019-05-31 Thread Vinay Sajip

Vinay Sajip  added the comment:

> Doing something as basic as logging unicode shouldn't require knowledge of 
> "handlers" - that's failing "simple is better than complex".

I reiterate my statement that it appears that you aren't sufficiently familiar 
with how logging is designed to work. Logging is more complex than print() or 
open() because it has to work flexibly in lots of different scenarios. Handlers 
are part of this, as are Formatters and Filters.

See my 2009 blog post

https://plumberjack.blogspot.com/2009/09/python-logging-101.html

for more information for why logging is designed the way it is.

If you want to configure a stream with utf-8 encoding, without explicitly using 
handlers, this is easily doable, as follows:

C:\Users\Vinay> \python37\python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> logging.basicConfig(stream=open(r'c:\temp\my_log.log', 'w', 
>>> encoding='utf-8'))
>>> logging.error('จุด1')
>>> ^Z

and, lo and behold, the file c:\temp\my_log.log contains

ERROR:root:จุด1

The use of the stream keyword parameter is clearly documented at

https://docs.python.org/3/library/logging.html#logging.basicConfig

Did you look at the basicConfig documentation before raising this issue?

--

___
Python tracker 

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



Re: Hide text in entry box when i click on it.(GUI using Tkinter in python)

2019-05-31 Thread Chris Angelico
On Sat, Jun 1, 2019 at 5:11 AM  wrote:
>
> NOT WORKING IN MINE PLZ HELP
>
>
>
> from tkinter import *
> g=Tk()
> g.geometry("{0}x{1}+0+0".format(g.winfo_screenwidth(), 
> g.winfo_screenheight()))
> g.title("Check")
> g.configure(background='powder blue')
>
>
> def clear_search(event):
> e1.delete(0, tk.END)
>
> e1=Entry(g)
> e1.insert(0,'username')
> e1.pack()
> e1.bind("", clear_search)
> e1.bind("", clear_search)
>
> g.mainloop()

Did you look at the exception you get when this runs? It might
possibly be able to point you to the problem, and maybe suggest how
you could resolve it (by importing something, perhaps).

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


Re: Hide text in entry box when i click on it.(GUI using Tkinter in python)

2019-05-31 Thread Rhodri James

On 31/05/2019 20:08, sakshamrahej...@gmail.com wrote:

NOT WORKING IN MINE PLZ HELP



from tkinter import *
g=Tk()

^^

g.geometry("{0}x{1}+0+0".format(g.winfo_screenwidth(), g.winfo_screenheight()))
g.title("Check")
g.configure(background='powder blue')


def clear_search(event):
 e1.delete(0, tk.END)

^^


e1=Entry(g)
e1.insert(0,'username')
e1.pack()
e1.bind("", clear_search)
e1.bind("", clear_search)

g.mainloop()


Spot the difference between the identifiers I underlined.  If you run 
this from the command line, the traceback tells you exactly what is 
going on.


--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


[issue23667] IDLE to provide option for making trailing whitespace visible

2019-05-31 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Raymond, which definition of 'whitespace' do you intent?

Git gui also marks trailing spaces in frozen diffs.  This is much harder to do 
while editing as text can be read, keyed, and pasted.  Most spaces and blank 
lines are only temporarily trailing, before something more is added.  I believe 
I would dislike the idea of temporarily marking them, unless it were very 
subtle.  They really only need to be stripped just before saving.  So I think 
we should make that easy and not too intrusive. 

1. Ask if there is trailing whitespace.  For instance,
if (text.find('\s\n') != -1) or :


2. Add a setting to strip on save, default yes.

3. always strip trailing whitespace from .py files when saving.
Perhaps flash 'trailing whitespace stripped' to status bar.

The danger with any of these is stripping of wanted trailing whitespace in 
tripple-quoted string literals.  Such whitespace is rare, but I don't know how 
rare.

Alternate ways of making such are better in making the blanks permanently 
visible in any display, not just in IDLE.  The problem is teaching this.

>>> s = (
  'This is justified text\n'
  'with blank spaces.\n'
  'It is is followed by  \n'
  'a trailing blank line.\n'
  '\n')
>>> s
'This is justified text\nwith blank spaces.\nIt is is followed by  \na 
trailing blank line.\n\n'

while an error marking would tell users to do it manually.
---

I closed PR 1644 because implementing features as extensions is obsolete and 
because the trim function duplicates the existing function (once it is fixed to 
include blank lines).

I am dubious about PR 1643.  Tagging trailing whitespace as an error would 
suggest that the user should delete it.  With strip on save, this would be 
noise.

--
stage: patch review -> needs patch
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



Re: Hide text in entry box when i click on it.(GUI using Tkinter in python)

2019-05-31 Thread sakshamraheja11
NOT WORKING IN MINE PLZ HELP



from tkinter import *
g=Tk()
g.geometry("{0}x{1}+0+0".format(g.winfo_screenwidth(), g.winfo_screenheight()))
g.title("Check")
g.configure(background='powder blue')


def clear_search(event): 
e1.delete(0, tk.END) 

e1=Entry(g)
e1.insert(0,'username')
e1.pack()
e1.bind("", clear_search)
e1.bind("", clear_search)

g.mainloop()
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37117] Simplify customization of the logging time through datefmt

2019-05-31 Thread Vinay Sajip


Vinay Sajip  added the comment:

The documentation mentions that the converter attribute of the formatter should 
be signature-compatible with time.localtime() and time.gmtime(), and some users 
will have set this attribute with one or the other or a compatible function. 
Doesn't your change break backward compatibility by changing the signature of 
the converter?

If one wants to implement the functionality you're suggesting, one could 
implement a Formatter subclass that does it, isn't that right? That wouldn't 
cause backward compatibility problems, and could be added in a cookbook recipe.

--

___
Python tracker 

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



Re: Hide text in entry box when i click on it.(GUI using Tkinter in python)

2019-05-31 Thread sakshamraheja11
Not happening in mine
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue12639] msilib Directory.start_component() fails if keyfile is not None

2019-05-31 Thread Zackery Spytz


Zackery Spytz  added the comment:

Thanks for looking at this issue, Steve.

At this point in time, 3.6 only takes security fixes, so PR 13703 should be 
closed.

The Close() method was added in 3.7, so I think removing the addCleanup() call 
is the way to go for 2.7.

--

___
Python tracker 

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



[issue37111] Logging - Inconsistent behaviour when handling unicode

2019-05-31 Thread Jonathan


Jonathan  added the comment:

Thank you for your comments but this wasn't a question and I maintain this is a 
bug, or at least undesirable behaviour. I'd consider it a bug in my own 
software.

Reasoning:
* It's an inconsistent default with the logging to screen. This causes more 
complexity for users when their bug is intermittent.
* Despite your assertion, it's not documented anywhere on the logging docs (I 
did check before creating this bug when trying to figure out what's going on) - 
The word "utf" or "unicode" doesn't appear on the logging page, or any of the 
two tutorials, or the logging.handlers page. There's something in the cookbook 
but that's about BOM's.
* Much of the world's native characters won't log to ASCII

Per this page: https://docs.python.org/3/howto/unicode.html
"UTF-8 is one of the most commonly used encodings, and Python often defaults to 
using it."

> People have been using logging, on Windows, without problems, for years, 
> often using utf-8 to encode their log files.
I'm afraid this line of reasoning is suffering from selection bias, cherry 
picking, confirmation bias, and probably some others too. Clearly people have 
had problems before because it was from one of those folks I took the solution.

Doing something as basic as logging unicode shouldn't require knowledge of 
"handlers" - that's failing "simple is better than complex".

--

___
Python tracker 

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



[issue36947] [Good first issue] Fix 3.3.3.1 Metaclasses Documentation

2019-05-31 Thread Chirag Garg


Chirag Garg  added the comment:

It should be written like "In the following example, both MyClass and 
MySubclass are instances of Meta and the type of MyClass is of metaclass Meta 
and type of MySubclass is MyClass:"

--
nosy: +codevil_2o

___
Python tracker 

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



[issue36896] clarify in types.rst that FunctionTypes & co constructors don't have stable signature

2019-05-31 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Victor recently implemented CodeType.replace(); which I believe will cover many 
of the usecase.

Should I also send a PR that update the DocStrings of (some of) ? these 
objects? many people don't go and read the html docs...

--

___
Python tracker 

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



[issue10936] Simple CSS fix for left margin at docs.python.org

2019-05-31 Thread Chirag Garg


Chirag Garg  added the comment:

Yes, it is creating a vision problem as the text is creating a problem. And the 
CSS script of @cdunn2001 is correct also there is a need to change the 
navigation bar.

--
nosy: +codevil_2o

___
Python tracker 

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



[issue37117] Simplify customization of the logging time through datefmt

2019-05-31 Thread Mario Corchero


New submission from Mario Corchero :

Users that want to provide a custom template for the timestamp part of logging 
cannot customize the milliseconds part of asctime.

They can use the msecs attribute of the Logger but that effectively requires to 
break the formatting in two parts. Note that it is not necessary to provide 
msecs on the default template as there is code that handles it in 
https://github.com/python/cpython/blob/c8d5bf6c3fa09b43f6a5ee779d493d251dbcc53c/Lib/logging/__init__.py#L603

Something we can do to improve this situation is changing the default converter 
to produce a datetime rather than a timetuple, as strftime of datetime and time 
uses the same template format.

This will allow changing the format including milliseconds through the datefmt 
argument.

formatter = logging.Formatter("%(asctime)s %(message)s", datefmt="%Y%m%d 
%H:%M:%S.%f")

Compare this to the current soltution:

formatter = logging.Formatter("%(asctime)s%(msecs)d %(message)s", 
datefmt="%Y%m%d %H:%M:%S")

Note how you need to split the formatting of time into two different parts. 
This becomes even more diserse if you also want to add something after the time 
formatting (Example: a Z to note UTC).

One more reason why this is quite powerful is that once we get timezones added 
to the standard library we will be able to (in a backward compatible way) just 
pass the timezone when we do `datetime.fromtimestamp`, which will add the 
timezone information to the datetime and users will be able to use %z to add 
the offset of the logging timestamp (Hurray! timestamps with offsets).

Sample implementation: 
https://github.com/mariocj89/cpython/commit/5047d730c0a0dcd6276f40c5b66762071dfcb448

If it looks interesting I can update the docs, add some further tests and send 
the PR. Wanted to confirm it is before putting time into that.

I cannot come with any "downside" of not doing it and I think it will simplify 
considerably the way users can format timestamps in logs. With this change we 
will just be able to say "To change the formatting of timestamps in a 
formatter, just use the datefmt argument".

Thoughts?

--
components: Library (Lib)
messages: 344102
nosy: mariocj89, p-ganssle, vinay.sajip
priority: normal
severity: normal
status: open
title: Simplify customization of the logging time through datefmt
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue12639] msilib Directory.start_component() fails if keyfile is not None

2019-05-31 Thread Steve Dower


Steve Dower  added the comment:

Looks like the tests need to be customized for 2.7 and 3.6:

Traceback (most recent call last):
  File "D:\a\1\s\lib\test\test_msilib.py", line 64, in 
test_directory_start_component_keyfile
self.addCleanup(db.Close)
AttributeError: '_msi.Database' object has no attribute 'Close'

I can edit directly in miss-islington's branch, but what's the change? Do we 
just remove the addCleanup code? Or should we just skip the backport?

--

___
Python tracker 

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



[issue26826] Expose new copy_file_range() syscall in os module.

2019-05-31 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset aac4d0342c3e692731c189d003dbd73a8c681a34 by Pablo Galindo in 
branch 'master':
bpo-26826: Expose copy_file_range in the os module (GH-7255)
https://github.com/python/cpython/commit/aac4d0342c3e692731c189d003dbd73a8c681a34


--
nosy: +pablogsal

___
Python tracker 

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



[issue36896] clarify in types.rst that FunctionTypes & co constructors don't have stable signature

2019-05-31 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Being said that, I am very happy with the current changes on the PR :)

 Thank you @Terry and @Petr for helping with this!

--

___
Python tracker 

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



[issue36842] Implement PEP 578

2019-05-31 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +13594
pull_request: https://github.com/python/cpython/pull/13707

___
Python tracker 

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



[issue37101] Filterer.filter can be rewritten using built-ins just as efficient much more readable

2019-05-31 Thread Dale Visser


Dale Visser  added the comment:

Adding the patch file associated with GitHub pull request #13683, as well as 
the performance test I just reported.

--
Added file: https://bugs.python.org/file48383/pr13683.diff

___
Python tracker 

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



[issue36540] PEP 570: Python Positional-Only Parameters

2019-05-31 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +13593
pull_request: https://github.com/python/cpython/pull/13706

___
Python tracker 

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



[issue36839] Support the buffer protocol in code objects

2019-05-31 Thread Brett Cannon


Brett Cannon  added the comment:

RE: "I think it needs significant benefits for typical users, not only for 
Instagram. If only Instagram get benefit from this, keep it as Instagram's 
internal patch."

But who's typical in this case? You? Me? We're talking code objects, something 
that the typical Python user doesn't even know exists if you take "typical" to 
mean "common" or "majority". I suspect if we asked Python developers if they 
knew what lnotab was an abbreviation of they wouldn't know, let alone how it 
worked.

And just because Instagram did this work and is making it public doesn't mean 
(a) others wouldn't use it or (b) others are already doing it privately. There 
are plenty of other companies with massive server installs of Python beyond 
Instagram.

My point is we have to be very careful when we start to claim we know what is 
typical or useful to the wider community considering how huge and diverse the 
Python community is.

--

___
Python tracker 

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



Re: Checking refusal of a network connection

2019-05-31 Thread Markus Elfring
>   Well, providing minimal code samples that produce the problem would be 
> a start.

I prefer an other approach to clarify relevant software configuration 
differences.


>   Otherwise we are just guessing...

I can offer other data before.


> Maybe you have a firewall problem.

I hope not.

I can try another server variant out as expected.


elfring@Sonne:~/Projekte/Python> /usr/bin/python3 test-server2.py &
[1] 14067
elfring@Sonne:~/Projekte/Python> /usr/bin/ss -t -l -p -H|grep python
LISTEN0  5  127.0.0.1:search-agent 0.0.0.0:*
 users:(("python3",pid=14067,fd=3))
elfring@Sonne:~/Projekte/Python> /usr/bin/python3 socket-send_json_data.py 
--server_id localhost --server_port 1234
Using Python version:
3.7.2 (default, Dec 30 2018, 16:18:15) [GCC]
elfring@Sonne:~/Projekte/Python> Result:
…


Can connections work also with a network service address like “[::1]:35529”
(which would be used by the C++ server implementation so far)?
How does the software situation look like for the support of the IPv6 loopback 
address?

Regards,
Markus
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36896] clarify in types.rst that FunctionTypes & co constructors don't have stable signature

2019-05-31 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Although I completely agree with the decision of figuring out an explicit 
consensus regarding these APIs, I will explain a bit my +1:

My +1 is not about the usage of PyCode_New, is about the usage of 
`types.CodeType`. The constructor for the later has never been documented on 
the Python side, so one could argue that is not a supported feature to manually 
construct code objects.

The more we expose and call "stable" regarding internals, the less freedom we 
will have to apply optimizations and add additional data members to internal 
structures.

With this, I am not saying that we should say that whoever uses this is a 
"roge" project but marking these APIs as stable will greatly restrict future 
changes.

--
nosy: +pablogsal

___
Python tracker 

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



[issue37094] Provide an example for TestCase.skipTest in unittest doc

2019-05-31 Thread Zachary Ware


Zachary Ware  added the comment:

Thanks for the patch!

--
nosy: +zach.ware
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue12639] msilib Directory.start_component() fails if keyfile is not None

2019-05-31 Thread miss-islington


miss-islington  added the comment:


New changeset 49fc57abf5fcf60129e460046d78c9bf20a19931 by Miss Islington (bot) 
in branch '3.7':
bpo-12639: msilib.Directory.start_component() fails if *keyfile* is not None 
(GH-13688)
https://github.com/python/cpython/commit/49fc57abf5fcf60129e460046d78c9bf20a19931


--
nosy: +miss-islington

___
Python tracker 

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



[issue36721] Add pkg-config python-3.8-embed and --embed to python3.8-config

2019-05-31 Thread Michael Haubenwallner


Change by Michael Haubenwallner :


--
pull_requests: +13592
pull_request: https://github.com/python/cpython/pull/737

___
Python tracker 

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



[issue15590] --libs is inconsistent for python-config --libs and pkgconfig python --libs

2019-05-31 Thread Ned Deily


Change by Ned Deily :


--
nosy: +vstinner

___
Python tracker 

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



[issue25735] math.factorial doc should mention integer return type

2019-05-31 Thread miss-islington


miss-islington  added the comment:


New changeset fc3b8437c86167983cc75e5a9a3ed1dc542a1b79 by Miss Islington (bot) 
in branch '3.7':
bpo-25735: math.factorial doc should mention integer return type (GH-6420)
https://github.com/python/cpython/commit/fc3b8437c86167983cc75e5a9a3ed1dc542a1b79


--
nosy: +miss-islington

___
Python tracker 

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



[issue37116] Use PEP 570 syntax for positional-only parameters

2019-05-31 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +pablogsal

___
Python tracker 

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



[issue37109] Inacurrate documentation regarding return type of math.factorial

2019-05-31 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Thanks for pointing out the other issue.  I've now merged it.

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue12639] msilib Directory.start_component() fails if keyfile is not None

2019-05-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13589
pull_request: https://github.com/python/cpython/pull/13703

___
Python tracker 

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



[issue12639] msilib Directory.start_component() fails if keyfile is not None

2019-05-31 Thread Steve Dower


Steve Dower  added the comment:

Thanks, Zackery!

The backports are running CI now and should merge if everything passes.

--
stage: patch review -> backport needed

___
Python tracker 

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



[issue12639] msilib Directory.start_component() fails if keyfile is not None

2019-05-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13590
pull_request: https://github.com/python/cpython/pull/13704

___
Python tracker 

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



[issue25735] math.factorial doc should mention integer return type

2019-05-31 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

@John.Yeung, thank you for the report.  @mine0901, thanks for the initial patch 
and @akshaysharma, thank you for the PR.

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



[issue12639] msilib Directory.start_component() fails if keyfile is not None

2019-05-31 Thread Steve Dower


Steve Dower  added the comment:


New changeset c8d5bf6c3fa09b43f6a5ee779d493d251dbcc53c by Steve Dower (Zackery 
Spytz) in branch 'master':
bpo-12639: msilib.Directory.start_component() fails if *keyfile* is not None 
(GH-13688)
https://github.com/python/cpython/commit/c8d5bf6c3fa09b43f6a5ee779d493d251dbcc53c


--

___
Python tracker 

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



[issue12639] msilib Directory.start_component() fails if keyfile is not None

2019-05-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13591
pull_request: https://github.com/python/cpython/pull/13705

___
Python tracker 

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



[issue25735] math.factorial doc should mention integer return type

2019-05-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13588
pull_request: https://github.com/python/cpython/pull/13702

___
Python tracker 

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



[issue25735] math.factorial doc should mention integer return type

2019-05-31 Thread Cheryl Sabella


Cheryl Sabella  added the comment:


New changeset 4612671df2742eade8ecf8003a6ce1247973c135 by Cheryl Sabella 
(Akshay Sharma) in branch 'master':
bpo-25735: math.factorial doc should mention integer return type (GH-6420)
https://github.com/python/cpython/commit/4612671df2742eade8ecf8003a6ce1247973c135


--

___
Python tracker 

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



[issue26835] Add file-sealing ops to fcntl

2019-05-31 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 8cbb5b6625268400d6e9092b75b06d6f90398dc9 by Christian Heimes in 
branch 'master':
bpo-26835: Add file sealing constants to fcntl (GH-13694)
https://github.com/python/cpython/commit/8cbb5b6625268400d6e9092b75b06d6f90398dc9


--

___
Python tracker 

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



[issue37094] Provide an example for TestCase.skipTest in unittest doc

2019-05-31 Thread miss-islington


miss-islington  added the comment:


New changeset 8135455c840b9e169a6cd527cb1ee922cafb9109 by Miss Islington (bot) 
in branch '3.7':
bpo-37094: Add example for TestCase.skipTest in unittest doc (GH-13645)
https://github.com/python/cpython/commit/8135455c840b9e169a6cd527cb1ee922cafb9109


--

___
Python tracker 

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



[issue37094] Provide an example for TestCase.skipTest in unittest doc

2019-05-31 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



  1   2   >