[issue37612] os.link(..., follow_symlinks=True) broken on Linux

2019-07-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Not always linkat() can be used instead of link(). But on Windows (where there 
is no linkat()) os.link() creates a new link to the symbolic link itself. This 
is yet one argument for making follow_symlinks=False by default and changing 
the default behavior of os.link() on NetBSD.

--
nosy: +eryksun, larry, serhiy.storchaka

___
Python tracker 

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



[issue37555] _CallList.__contains__ doesn't always respect ANY.

2019-07-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +cjw296, mariocj89, michael.foord

___
Python tracker 

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



[issue37618] Docs: Code example locations in stdtypes

2019-07-18 Thread Kyle Stanley


New submission from Kyle Stanley :

In the docs for the module stdtypes, the code example for several commonly used 
functions are in the bytearray section instead of the str section, where new 
users are far more likely to look. The new users are much more likely to 
benefit from seeing examples of these functions. A few examples of this 
include: islower(), isupper(), and istitle(). Since the functionality is very 
similar for functions such as str.islower() and bytearray.islower(), it doesn't 
seem necessary to include separate examples for each. With that in mind, here's 
a couple of potential solutions:

1) Move the location of the code examples to the str equivalent. This would 
require only removing the 'b' notation proceeding the strings. A link to the 
str equivalent could be potentially provided.

2) Provide a reference link to equivalent bytearray function in the str 
function's summary. This would be a bit easier since the code examples would 
not have to me modified or moved. However, for reasons stated above, it seems 
to make a bit more sense to have the examples be in the str functions rather 
than in the bytearray functions.

I can start working on a PR to address this, but I'll wait on some feedback 
first.

--
assignee: docs@python
components: Documentation
messages: 348104
nosy: aeros167, docs@python
priority: normal
severity: normal
status: open
title: Docs: Code example locations in stdtypes
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue37555] _CallList.__contains__ doesn't always respect ANY.

2019-07-18 Thread Elizabeth Uselton


Elizabeth Uselton  added the comment:

Just added a fix for the tests I added in the last commit showing the order 
sensitivity in assertEqual when dealing with ANY and _Call or _CallList 
objects. _Call and _CallList currently depend on ordering to correctly process 
that an object being compared to ANY with __eq__ should return True. I put more 
notes in the commit message.

A note on the two newer tests: I want to be sensitive to the idea that I might 
be pushing back against desired behavior here. I think there is a case to be 
made that one should expect mock.assertEqual(a, b) to implement a == b, and not 
care about b == a, in which case maybe order sensitivity in assertEqual makes 
sense. That said, today I showed a few of my most Python experience heavy 
colleagues the tests showing that assertEqual was order sensitive when passed 
_Call or _CallList objects, and based on anecdotal evidence the existing 
behavior definitely violates the principle of least astonishment. Additionally, 
the test Karthikeyan kindly linked me 
https://github.com/python/cpython/blob/master/Lib/unittest/test/testmock/testhelpers.py#L46
 seems to imply that an order agnostic assertEqual is the desired behavior.

A note on the fix: This fix feels like it's not as small as it could be. I am 
still musing over whether it'd be better if instead of the or statements and 
swapping the comparison order in _CallList's __contains__ method, I made a 
wrapper that would swap that comparison order in the case that one of the 
arguments is a BoundArgument, since that was the original problem. That fix 
would probably not affect the order sensitivity of assertEqual, so it's 
partially about what we want there. I'll play around with it and see what I can 
discover. I'll also see if I can do anything to more explicitly to check for 
ANY, as Paul suggested.

I'm very curious what you all think about whether the assertEqual behavior is a 
feature or a bug, and if the other fix idea seems better than this one. If 
neither of these ideas seem like a good fix, I'd love some guidance on what 
concerns are and what might be a good approach to try next.

--

___
Python tracker 

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



[issue37618] Docs: Code example locations in stdtypes

2019-07-18 Thread Kyle Stanley


Kyle Stanley  added the comment:

Clarification on option 1: The last sentence should be "A link to the bytearray 
equivalent..."

Clarification on option 2: As a part of this option, a link to the str 
equivalent could optionally be provided.

--

___
Python tracker 

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



[issue34621] uuid.UUID objects can't be unpickled in older Python versions (<3.7)

2019-07-18 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +14625
pull_request: https://github.com/python/cpython/pull/14834

___
Python tracker 

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



[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2019-07-18 Thread Aldwin Pollefeyt


Change by Aldwin Pollefeyt :


--
pull_requests: +14626
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/14835

___
Python tracker 

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



[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2019-07-18 Thread Aldwin Pollefeyt


Aldwin Pollefeyt  added the comment:

* there were many small issues with the patch, improved as good as possible the 
FixString to catch ```import as```, ```from string import *``` and ```import 
string```

* did not include the FixStringImports as it's not a necessity to work in 
Python3

* indeed, some uses of the constant names that are user-defined will also 
rename, only when it's in a ```import string```. Added a ```Caution``` in the 
documentation. Still, when all are changed, it should not affect the Python3 
version, will just work with the renamed variable name.

--
nosy: +aldwinaldwin

___
Python tracker 

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



[issue37619] update_one_slot() should not ignore wrapper descriptors for wrong type

2019-07-18 Thread Jeroen Demeyer


New submission from Jeroen Demeyer :

>>> class S(str):
... __eq__ = int.__eq__
>>> S() == S()
True

The expectation is that this raises an exception because int.__eq__() is called 
on S instances.

--
components: Interpreter Core
messages: 348108
nosy: jdemeyer
priority: normal
severity: normal
status: open
title: update_one_slot() should not ignore wrapper descriptors for wrong type
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-07-18 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy: +yan12125

___
Python tracker 

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



[issue37619] update_one_slot() should not ignore wrapper descriptors for wrong type

2019-07-18 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


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

___
Python tracker 

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



[issue31710] setup.py: _ctypes won't get built when system ffi is only in $PREFIX

2019-07-18 Thread Paul Hege


Paul Hege  added the comment:

I had also received the same warnings when running make:
"INFO: Could not locate ffi libs and/or headers"
and "Failed to build these modules: _ctypes". Although Python could still be 
installed, the pip command was not installed, and installing it using 
get_pip.py just led to an error indicating that the module "_ctypes" was not 
found.

I can confirm that setting CPPFLAGS and LDFLAGS as well as PKG_CONFIG_PATH, as 
suggested my Mr. Levchenko, allowed me to build and install python 3.7.1 
locally without root privileges with ctypes and pip included and working, using 
a libffi also compiled from source.

--
nosy: +Paul Hege

___
Python tracker 

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



[issue37612] os.link(..., follow_symlinks=True) broken on Linux

2019-07-18 Thread Eryk Sun


Eryk Sun  added the comment:

> on Windows (where there is no linkat()) os.link() creates a new link
> to the symbolic link itself. 

Yes, CreateHardLinkW opens the source file by calling NtOpenFile with the 
option FILE_OPEN_REPARSE_POINT. So the behavior is follow_symlinks=False. 

Note, however, that Windows has distinct file and directory reparse points, so 
we can't hardlink to a directory symlink, or any other type of directory 
reparse point such as a junction mountpoint. In Unix, follow_symlinks=False (if 
implemented) allows creating a hardlink to a symlink that targets a directory.

Also, I noticed that I can pass follow_symlinks=False in Windows, but this 
should raise NotImplementedError. It's supposed to be checked via 
follow_symlinks_specified().

--

___
Python tracker 

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



[issue37612] os.link(..., follow_symlinks=True) broken on Linux

2019-07-18 Thread Jo Henke


Jo Henke  added the comment:

The problem that POSIX does not define the behavior of link() regarding 
symlinks (and that Unix implementations differ indeed), is independent from 
Python's os.link() defaults.

Since it makes no sense to call link(), when linkat() is available, I propose 
this change:

--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -3512,15 +3512,11 @@ os_link_impl(PyObject *module, path_t *src, path_t 
*dst, int src_dir_fd,
 #else
 Py_BEGIN_ALLOW_THREADS
 #ifdef HAVE_LINKAT
-if ((src_dir_fd != DEFAULT_DIR_FD) ||
-(dst_dir_fd != DEFAULT_DIR_FD) ||
-(!follow_symlinks))
-result = linkat(src_dir_fd, src->narrow,
-dst_dir_fd, dst->narrow,
-follow_symlinks ? AT_SYMLINK_FOLLOW : 0);
-else
+result = linkat(src_dir_fd, src->narrow, dst_dir_fd, dst->narrow,
+follow_symlinks ? AT_SYMLINK_FOLLOW : 0);
+#else
+result = link(src->narrow, dst->narrow);
 #endif /* HAVE_LINKAT */
-result = link(src->narrow, dst->narrow);
 Py_END_ALLOW_THREADS

 if (result)


This fix also simplifies the code, and should be safe for back-porting.

Whether Python's defaults should be changed regarding Windows and those (mostly 
obsolete) Unix platforms that do not provide linkat(), is another question.

--

___
Python tracker 

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



[issue34697] ctypes: Crash if manually-created CField instance is used

2019-07-18 Thread hai shi


Change by hai shi :


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

___
Python tracker 

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



[issue37587] JSON loads performance improvement for long strings

2019-07-18 Thread Inada Naoki


Inada Naoki  added the comment:

> 1. remove the mov entirely. It is not needed inside the loop and it is only 
> needed later, outside the loop to access the variable

How can we lazy "movDWORD PTR [rsp+0x44],eax"?

--
nosy: +inada.naoki

___
Python tracker 

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



[issue34697] ctypes: Crash if manually-created CField instance is used

2019-07-18 Thread hai shi


hai shi  added the comment:

I have try to cancel this PyCField_new function, but i am not sure I haven't 
break the code structure.

--
nosy: +shihai1991

___
Python tracker 

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



[issue37587] JSON loads performance improvement for long strings

2019-07-18 Thread Inada Naoki

Inada Naoki  added the comment:

Some compilers produce inefficient code for PR-14752.
I wrote another patch which is friendly to more compilers.


$ perf record ./python -m pyperf timeit  -s "import json; x = json.dumps({'k': 
'1' * 2 ** 20})" "json.loads(x)"

# PR-14752

gcc-7 (Ubuntu 7.4.0-8ubuntu1) 7.4.0
Mean +- std dev: 1.11 ms +- 0.01 ms

```
   │ scanstring_unicode():
   │ c = PyUnicode_READ(kind, buf, next);
 11.92 │270:   movzbl (%r15,%r8,1),%eax
   │ if (c == '"' || c == '\\') {
 27.97 │   cmp$0x22,%eax
   │ c = PyUnicode_READ(kind, buf, next);
 29.22 │   mov%eax,0x34(%rsp)
   │ if (c == '"' || c == '\\') {
  0.46 │ ↑ je ef
  0.02 │   cmp$0x5c,%eax
   │ ↑ je ef
   │ if (c <= 0x1f && invalid < 0) {
   │   cmp$0x1f,%eax
  0.00 │ ↓ ja 297
   │   test   %rdx,%rdx
   │   cmovs  %r8,%rdx
   │ for (next = end; next < len; next++) {
 29.49 │297:   add$0x1,%r8
   │   cmp%r8,%r12
  0.92 │ ↑ jne270
```

gcc-8 (Ubuntu 8.3.0-6ubuntu1) 8.3.0
Mean +- std dev: 712 us +- 1 us
```
   │ c = PyUnicode_READ(kind, buf, next);
   │188:   movzbl 0x0(%rbp,%rbx,1),%eax
   │   mov%eax,0x34(%rsp)
   │ if (c == '"' || c == '\\') {
   │   cmp$0x22,%eax
   │ ↓ je 1d0
   │   nop
  0.00 │1a0:   cmp$0x5c,%eax
   │ ↓ je 1d0
   │ if (c <= 0x1f && invalid < 0) {
   │   cmp$0x1f,%eax
 49.84 │ ↓ ja 1b1
   │   test   %rdx,%rdx
   │   cmovs  %rbx,%rdx
   │ for (next = end; next < len; next++) {
   │1b1:   add$0x1,%rbx
  0.00 │   cmp%rbx,%r15
   │ ↑ je ff
   │ c = PyUnicode_READ(kind, buf, next);
  0.61 │   movzbl 0x0(%rbp,%rbx,1),%eax
 49.53 │   mov%eax,0x34(%rsp)
   │ if (c == '"' || c == '\\') {
  0.01 │   cmp$0x22,%eax
   │ ↑ jne1a0
  0.00 │   nop
```

clang version 7.0.1-8 (tags/RELEASE_701/final)
Mean +- std dev: 951 us +- 1 us

```
   │ c = PyUnicode_READ(kind, buf, next);
  9.76 │110:   movzbl (%r12,%r13,1),%eax
  9.47 │   mov%eax,0xc(%rsp)
  8.85 │   cmp$0x22,%eax
   │ if (c == '"' || c == '\\') {
   │ ↓ je 170
  8.78 │   cmp$0x5c,%al
   │ ↓ je 170
   │ if (c <= 0x1f && invalid < 0) {
  9.16 │   cmp$0x20,%al
  9.09 │   mov%rdx,%rcx
  9.16 │   cmovb  %r13,%rcx
  9.00 │   test   %rdx,%rdx
  8.78 │   cmovs  %rcx,%rdx
   │ for (next = end; next < len; next++) {
  9.09 │   add$0x1,%r13
   │   cmp%r15,%r13
  8.86 │ ↑ jl 110
   │ ↓ jmp170
   │   nop
```

clang version 8.0.0-3 (tags/RELEASE_800/final)
Mean +- std dev: 953 us +- 0 us

```
   │ c = PyUnicode_READ(kind, buf, next);
 10.04 │100:   movzbl (%r15,%r14,1),%eax
  9.27 │   mov%eax,0x4(%rsp)
  8.87 │   cmp$0x22,%eax
   │ if (c == '"' || c == '\\') {
   │ ↓ je 160
  8.78 │   cmp$0x5c,%al
   │ ↓ je 160
   │ if (c <= 0x1f && invalid < 0) {
  8.97 │   cmp$0x20,%al
  8.97 │   mov%rdx,%rcx
  8.89 │   cmovb  %r14,%rcx
  8.81 │   test   %rdx,%rdx
  9.14 │   cmovs  %rcx,%rdx
   │ for (next = end; next < len; next++) {
  9.25 │   add$0x1,%r14
   │   cmp%rdi,%r14
  8.99 │ ↑ jl 100
   │ ↓ jmp160
   │   nop
```

# modified

```
/* Find the end of the string or the next escape */
Py_UCS4 c;
{
Py_UCS4 d = 0;
for (next = end; next < len; next++) {
d = PyUnicode_READ(kind, buf, next);
if (d == '"' || d == '\\') {
break;
}
if (d <= 0x1f && strict) {
raise_errmsg("Invalid control character at", pystr, next);
goto bail;
}
}
c = d;
}
```


gcc-7 (Ubuntu 7.4.0-8ubuntu1) 7.4.0
Mean +- std dev: 708 us +- 1 us

```
   │ for (next = end; next < len; next++) {
 20.29 │170:   add$0x1,%rbx
  0.31 │   cmp%rbx,%r12
   │ ↓ je 1b0
   │ d = PyUnicode_READ(kind, buf, next);
 44.48 │179:   movzbl 0x0(%rbp,%rbx,1),%eax
   │ if (d == '"' || d == '\\') {
  5.38 │   cmp$0x22,%eax
   │ ↓ je 2c0
 23.82 │   cmp$0x5c,%eax
   │ ↓ je 2c0
   │ if (d <= 0x1f && strict) {
   │   cmp$0x1f,%eax
  5.68 │ ↑ ja 170
   │   test   %r13d,%r13d
 

[issue37552] [Windows] strptime/strftime return invalid results with UCRT version 17763.615

2019-07-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14629
pull_request: https://github.com/python/cpython/pull/14839

___
Python tracker 

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



[issue37552] [Windows] strptime/strftime return invalid results with UCRT version 17763.615

2019-07-18 Thread Paul Ganssle


Paul Ganssle  added the comment:


New changeset 9cd39b16e2655f748f7aa8d20bca4812da00ba70 by Paul Ganssle (Paul 
Monson) in branch 'master':
bpo-37552: Skip failing tests in strptime/strftime with UCRT version 17763.615 
(#14460)
https://github.com/python/cpython/commit/9cd39b16e2655f748f7aa8d20bca4812da00ba70


--
message_count: 1.0 -> 2.0
nosy: +p-ganssle
nosy_count: 5.0 -> 6.0
pull_requests: +14629
pull_request: https://github.com/python/cpython/pull/14839

___
Python tracker 

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



[issue37620] str.split(sep=None, maxsplit=-1,any=False)

2019-07-18 Thread Harry Coin


New submission from Harry Coin :

When first I read the str.split documentation I parsed it to mean
'ab\t cd ef'.split(sep=' \t') --> ['ab','cd','ef']
Especially as the given example in the docs with the <> would have led to the 
given result read the way I read it.

I suggest adding a parameter 'any=False' which by default gives the current 
behavior.  But when True treats each character in the sep string as a delimiter 
and eliminates any combination of them from the resulting list.

The use cases are many, for example parsing the /etc/hosts file where we see an 
address, some white space that could be any combination of \t and ' ' followed 
by more text. 

One could imagine 'abc  \tdef, hgi,jlk'.split(', \t',any=True) -> 
['abc','def','hgi','jlk'] being used quite often.

--
components: Library (Lib)
messages: 348116
nosy: hcoin
priority: normal
severity: normal
status: open
title: str.split(sep=None, maxsplit=-1,any=False)
type: enhancement

___
Python tracker 

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



[issue37621] Line continuation of blank line emits NEWLINE

2019-07-18 Thread Dominik Miedziński

New submission from Dominik Miedziński :

Both C and Python tokenizers emit NEWLINE tokens on continued blank lines. 
Because of this it is possible to emit repeated NEWLINEs, which some tools 
don't expect to happen.

I've attached example source file which is tokenized into 3 NEWLINE tokens in a 
row.

--
components: Interpreter Core
files: linecont.py
messages: 348117
nosy: miedzinski
priority: normal
severity: normal
status: open
title: Line continuation of blank line emits NEWLINE
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file48488/linecont.py

___
Python tracker 

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



[issue37552] [Windows] strptime/strftime return invalid results with UCRT version 17763.615

2019-07-18 Thread miss-islington


miss-islington  added the comment:


New changeset 652b667b13fc6176a565538b35ec11174cc9dacf by Miss Islington (bot) 
in branch '3.8':
bpo-37552: Skip failing tests in strptime/strftime with UCRT version 17763.615 
(GH-14460)
https://github.com/python/cpython/commit/652b667b13fc6176a565538b35ec11174cc9dacf


--
nosy: +miss-islington

___
Python tracker 

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



[issue37621] Line continuation of blank line emits NEWLINE

2019-07-18 Thread Dominik Miedziński

Change by Dominik Miedziński :


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

___
Python tracker 

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



[issue37609] support "UNC" device paths in ntpath.splitdrive

2019-07-18 Thread Ngalim Siregar


Change by Ngalim Siregar :


--
keywords: +patch
pull_requests: +14632
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/14841

___
Python tracker 

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



[issue36833] Add tests for Datetime C API Macros

2019-07-18 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +nanjekyejoannah
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



[issue37622] Signature of SHA256 HMAC digest not matching with the signature of jwt library

2019-07-18 Thread Dodain


New submission from Dodain :

The signature (SHA256 of HMAC Digest) calculated using hmac library doesn't 
match the signature calculated using jwt library. The singature calculated 
using JWT is the right signature.

The signature with JWT library is VXG8L0SEY3wo5hdAznbvxWXDbhNtuOd7PaZOhzZn_HQ

Whereas the signature with hmac library is 
SHR3SSe+8+X8eBw/H+CUc6f5KyXmuONfprdttjeQrwQ=


Since only one file can bu attached so I am inlining the code for finding jwt 
signature with jwt library. The code for HMAC library is attached. 

import jwt
public = "1234"
print (public)
print jwt.encode({"login":"admin"}, key=public, algorithm='HS256')

--
components: Library (Lib)
files: sign_with_hmac_library.py
messages: 348119
nosy: dodain
priority: normal
severity: normal
status: open
title: Signature of SHA256 HMAC digest not matching with the signature of jwt 
library
type: behavior
versions: Python 2.7
Added file: https://bugs.python.org/file48489/sign_with_hmac_library.py

___
Python tracker 

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



[issue36833] Add tests for Datetime C API Macros

2019-07-18 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


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

___
Python tracker 

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



[issue37612] os.link(..., follow_symlinks=True) broken on Linux

2019-07-18 Thread Jo Henke


Change by Jo Henke :


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

___
Python tracker 

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



[issue16970] argparse: bad nargs value raises misleading message

2019-07-18 Thread sushma


sushma  added the comment:

Hello!

I added the patch and submitted the PR and ran the test, could you please take 
a look?

Also, I see this 3.6

Thanks

--
message_count: 8.0 -> 9.0
nosy: +syadlapalli
nosy_count: 4.0 -> 5.0
pull_requests: +14635
stage: needs patch -> patch review
versions: +Python 3.6 -Python 2.7, Python 3.2, Python 3.3, Python 3.4
pull_request: https://github.com/python/cpython/pull/14844

___
Python tracker 

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



[issue37555] _CallList.__contains__ doesn't always respect ANY.

2019-07-18 Thread Elizabeth Uselton


Elizabeth Uselton  added the comment:

Giving this a reread with fresh eyes this morning, I realized I wasn't explicit 
enough in saying that I see that this fix is about the same as the one you 
mentioned, Karthikeyan, but said you were concerned might cause more subtle 
bugs. I hear that, and will try some more specific fixes, I was just trying to 
gather whether the tests showing 

self.assertEqual(call(ANY).call_list(), mock.mock_calls)
self.assertEqual(mock.mock_calls, call(ANY).call_list())

results in one passing and the other not (and the same for calls) changed the 
math on how brittle the current logic is, so just leaving it seemed like less 
of an option. I'll keep working on some other ideas though, whether we can 
check for ANY directly, or just wrap the BoundArguments that are causing 
problems when the mock has spec set.

--

___
Python tracker 

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



[issue13819] _warnings settings are process-wide

2019-07-18 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue36084] Threading: add builtin TID attribute to Thread objects

2019-07-18 Thread Jake Tesler


Change by Jake Tesler :


--
pull_requests: +14636
pull_request: https://github.com/python/cpython/pull/14845

___
Python tracker 

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



[issue35621] asyncio.create_subprocess_exec() only works with main event loop

2019-07-18 Thread Tim Froehlich


Tim Froehlich  added the comment:

Is it possible to amend the documentation 
(https://docs.python.org/3.5/library/asyncio-subprocess.html, etc) to include a 
note that the loop parameter doesn't work? I'm impacted by this bug and lost a 
few hours to it.

--
nosy: +Tim Froehlich

___
Python tracker 

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



[issue37616] [3.10 prep] zip path incorrect

2019-07-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue37617] [3.10 prep] site.py uses `sys.version[:3]`

2019-07-18 Thread Brett Cannon


Change by Brett Cannon :


--
resolution:  -> third party

___
Python tracker 

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



[issue34443] enum repr should use __qualname__

2019-07-18 Thread Ethan Furman

Ethan Furman  added the comment:


New changeset 323842c2792a81e87917790506ec3457832c84b3 by Ethan Furman (Walter 
Dörwald) in branch 'master':
bpo-34443: Use __qualname__ instead of __name__ in enum exception messages. 
(GH-14809)
https://github.com/python/cpython/commit/323842c2792a81e87917790506ec3457832c84b3


--

___
Python tracker 

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



[issue37623] namedtuple integration for importlib.abc.Loader

2019-07-18 Thread Andrew Yurisich


New submission from Andrew Yurisich :

I wanted to return a namedtuple from a concrete implementation of an 
importlib.abc.Loader base class, and wasn't able to provide a __spec__ property 
on the underlying class behind the namedtuple. All return values from 
importlib.abc.Loader#create_module need to have a __spec__ property set.

Similar to the namedtuple optional argument 'module', I'd like to be able to 
pass in a 'spec', and add this value to result.__spec__ before returning the 
final result.

--
components: Library (Lib)
messages: 348124
nosy: Andrew Yurisich
priority: normal
severity: normal
status: open
title: namedtuple integration for importlib.abc.Loader
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14637
pull_request: https://github.com/python/cpython/pull/14846

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-18 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset e0a1f8fb5c60886dbddf1a3ccb5d47576bdd43e2 by Terry Jan Reedy (Tal 
Einat) in branch 'master':
bpo-33610: IDLE's code-context always shows current context immediately 
(GH-14821)
https://github.com/python/cpython/commit/e0a1f8fb5c60886dbddf1a3ccb5d47576bdd43e2


--

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14638
pull_request: https://github.com/python/cpython/pull/14847

___
Python tracker 

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



[issue37623] namedtuple integration for importlib.abc.Loader

2019-07-18 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-18 Thread miss-islington


miss-islington  added the comment:


New changeset db2957c8ebbe1c4609b3fc730c6e682cb8ccfeb0 by Miss Islington (bot) 
in branch '3.7':
bpo-33610: IDLE's code-context always shows current context immediately 
(GH-14821)
https://github.com/python/cpython/commit/db2957c8ebbe1c4609b3fc730c6e682cb8ccfeb0


--

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-18 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 86eb5daaf31860da479e034d69e9a6d4f47a8eb6 by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.8':
bpo-33610: IDLE's code-context always shows current context immediately 
(GH-14821) (#14846)
https://github.com/python/cpython/commit/86eb5daaf31860da479e034d69e9a6d4f47a8eb6


--

___
Python tracker 

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



[issue37624] random.choices has unexpected behavior with negative weights

2019-07-18 Thread Ted Whalen


New submission from Ted Whalen :

The behavior of random.choices when negative weights are provided is 
unexpected. While giving a negative weight for one value is probably bad, it's 
really unfortunate that providing a negative weight for one value affects the 
probability of selecting an adjacent value.

Throwing a ValueError exception when there was a use of negative weights was 
considered in #31689, but at that time, there wasn't an example provided that 
failed silently.

Note below that providing a weight of -1 for 'c' causes both 'c' and 'd' to 
drop out of the results.

Python 3.7.2 (default, Jan 13 2019, 12:50:01)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import Counter
>>> from random import choices
>>> Counter(choices("abcdefg", weights=(1,1,-1,1,1,1,1), k=1))
Counter({'f': 2040, 'a': 2019, 'e': 2017, 'g': 2009, 'b': 1915})

--
components: Library (Lib)
messages: 348128
nosy: Ted Whalen
priority: normal
severity: normal
status: open
title: random.choices has unexpected behavior with negative weights
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



[issue35495] argparse does not honor default argument for nargs=argparse.REMAINDER argument

2019-07-18 Thread Michael Blahay


Michael Blahay  added the comment:

Ryan, I like option A as well, but it is a breaking change. Unlike in a 
compiled language where we could output a warning, making the proposed change 
could bring some software to a grinding halt. For now I'm going to make the 
documentation change and this issue can stay open for if there is a major 
version change that would allow such a breaking change.

--
versions: +Python 3.9 -Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue37623] namedtuple integration for importlib.abc.Loader

2019-07-18 Thread Eric V. Smith


Change by Eric V. Smith :


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

___
Python tracker 

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



[issue37625] Class variable is still accessible after class instance has been overwritten out

2019-07-18 Thread Daniel


New submission from Daniel :

Not sure if this is the desired behavior but wanted to bring it up anyways.
When you have a class and have a variable in like:
class TestClass(object):
variable = []

then you run it through a loop like:
for num in range(10):
test = TestClass()
test.variable.append(num)

even if you assign another variable to it or none like:
test = "blah"
test = None

then reassign the class:
test = TestClass()
print(test.variable)

will return all the numbers in the list.
also doesn't seem to matter if garbage collection was manually ran.

Attached is a small example code.
This was found on Macos and tested with both python 3.7 and 2.7 Subsequently 
same on ubuntu with python 3.5 and python 2.7

--
components: Interpreter Core
files: variabletest.py
messages: 348130
nosy: moird
priority: normal
severity: normal
status: open
title: Class variable is still accessible after class instance has been 
overwritten out
type: behavior
versions: Python 2.7, Python 3.5, Python 3.7
Added file: https://bugs.python.org/file48490/variabletest.py

___
Python tracker 

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



[issue37625] Class variable is still accessible after class instance has been overwritten out

2019-07-18 Thread Dominik Miedziński

Dominik Miedziński  added the comment:

This is expected, because list is created during class definition, not 
initialization. You should initialize `variable` in __init__.

class TestClass(object):
def __init__(self):
self.variable = []

for num in range(10):
test = TestClass()
test.variable.append(num)

--
nosy: +miedzinski

___
Python tracker 

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



[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-18 Thread Aldwin Pollefeyt


Change by Aldwin Pollefeyt :


--
keywords: +patch
pull_requests: +14640
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/14849

___
Python tracker 

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



[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-18 Thread Aldwin Pollefeyt


Change by Aldwin Pollefeyt :


--
pull_requests: +14641
pull_request: https://github.com/python/cpython/pull/14850

___
Python tracker 

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



[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-18 Thread Aldwin Pollefeyt


Change by Aldwin Pollefeyt :


--
nosy: +aldwinaldwin

___
Python tracker 

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



[issue37625] Class variable is still accessible after class instance has been overwritten out

2019-07-18 Thread Eric V. Smith


Eric V. Smith  added the comment:

Because variable belongs to the class, and not any instance of the class, you 
can duplicate this behavior without creating any instances at all:

>>> class TestClass(object):
... variable = []
...
>>> TestClass.variable.append(1)
>>> TestClass.variable
[1]

And then when you create an instance t, t.variable still refers to the class:

>>> t = TestClass()
>>> t.variable
[1]
>>>

This is expected behavior.

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-18 Thread miss-islington


miss-islington  added the comment:


New changeset 8f040b7a9f442e7c2605ef1cad9c6b5eb7dd7af7 by Miss Islington (bot) 
(aldwinaldwin) in branch 'master':
bpo-37610: improve Using Python doc wrt Editors & IDE (GH-14850)
https://github.com/python/cpython/commit/8f040b7a9f442e7c2605ef1cad9c6b5eb7dd7af7


--
nosy: +miss-islington

___
Python tracker 

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



[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14642
pull_request: https://github.com/python/cpython/pull/14851

___
Python tracker 

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



[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14643
pull_request: https://github.com/python/cpython/pull/14852

___
Python tracker 

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



[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-18 Thread Mariatta


Mariatta  added the comment:

Thanks for the PR! There's conflict to the 2.7 branch, but I'm not motivated 
enough to fix it there.

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



[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-18 Thread miss-islington


miss-islington  added the comment:


New changeset 87b6078fb90f11dc67ad8f31e98cbc40f74fcb81 by Miss Islington (bot) 
in branch '3.7':
bpo-37610: improve Using Python doc wrt Editors & IDE (GH-14850)
https://github.com/python/cpython/commit/87b6078fb90f11dc67ad8f31e98cbc40f74fcb81


--

___
Python tracker 

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



[issue37625] Class variable is still accessible after class instance has been overwritten out

2019-07-18 Thread Eric V. Smith


Eric V. Smith  added the comment:

Also, you might want to search for "python class and instance variables". This 
one looks decent, although I didn't read it exhaustively: 
https://howchoo.com/g/nzy0mthhyzl/understanding-class-vs-instance-variables-in-python-3

--

___
Python tracker 

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



[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-18 Thread miss-islington


miss-islington  added the comment:


New changeset 840352455dfbb6acb3b69ea88a19c01b7358e801 by Miss Islington (bot) 
in branch '3.8':
bpo-37610: improve Using Python doc wrt Editors & IDE (GH-14850)
https://github.com/python/cpython/commit/840352455dfbb6acb3b69ea88a19c01b7358e801


--

___
Python tracker 

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



[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-18 Thread Aldwin Pollefeyt


Aldwin Pollefeyt  added the comment:

just guessing ... in 2.7 unix.rst has '\ No newline at end of file'

it's your enhancement/call, but indeed no need to put energy in 2.7 doc 
anymore. case closed

--

___
Python tracker 

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



[issue37496] Support annotations in signature strings.

2019-07-18 Thread Giovanni Cappellotto


Giovanni Cappellotto  added the comment:

I'd like to work on this, but I'm kind of new to the codebase. Do you think I 
should leave this task to someone more expert on the matter?

I took a look at the function you mentioned and I was able to support simple 
annotations, for instance `x: int`, by evaluating `node.annotation.id`. This 
method doesn't work with more complex annotations thought. For instance a 
simple type alias (`Foo = int`, `x: Foo`) breaks this naive implementation. 
Another error happens if the annotation is not a simple `id`, but a subscript 
function application, for instance `x: List[int]`.

Do you have any suggestion for how to continue working on this task?

--

___
Python tracker 

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



[issue37624] random.choices has unexpected behavior with negative weights

2019-07-18 Thread Aldwin Pollefeyt


Aldwin Pollefeyt  added the comment:

This is what happens with your weights:

>>> list(itertools.accumulate(weights))
[1, 2, 1, 2, 3, 3, 4]

using bisect.bisect certain amount of times, will distribute on this:
a<1

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



[issue37624] random.choices has unexpected behavior with negative weights

2019-07-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +mark.dickinson, rhettinger

___
Python tracker 

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



[issue37624] random.choices has unexpected behavior with negative weights

2019-07-18 Thread Aldwin Pollefeyt


Change by Aldwin Pollefeyt :


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

___
Python tracker 

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



[issue37626] Documentation:conflict between docs

2019-07-18 Thread 徐靖

Change by 徐靖 :


--
assignee: docs@python
components: Documentation
nosy: docs@python, shiyuchong
priority: normal
severity: normal
status: open
title: Documentation:conflict between docs
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue37626] Documentation:conflict between docs

2019-07-18 Thread 徐靖

New submission from 徐靖 :

In https://docs.python.org/3/whatsnew/3.4.html#api-and-feature-removals,It is 
said "inspect.Signature: positional-only parameters are now required to have a 
valid name." 
But in 
https://docs.python.org/3/library/inspect.html?highlight=3.4#inspect.Signature, 
the actual change happened in inspect.Parameter, " Changed in version 3.4: In 
Python 3.3 Parameter objects were allowed to have name set to None if their 
kind was set to POSITIONAL_ONLY. This is no longer permitted."
So I wonder is it a mistake?

--

___
Python tracker 

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



[issue37626] Documentation:conflict between docs

2019-07-18 Thread SilentGhost


Change by SilentGhost :


--
nosy: +yselivanov

___
Python tracker 

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



[issue37587] JSON loads performance improvement for long strings

2019-07-18 Thread Inada Naoki


Change by Inada Naoki :


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



[issue37626] Documentation:conflict between docs

2019-07-18 Thread Inada Naoki


Inada Naoki  added the comment:

https://docs.python.org/3/library/inspect.html#inspect.Parameter.replace

"""
Changed in version 3.4: In Python 3.3 Parameter objects were allowed to have 
name set to None if their kind was set to POSITIONAL_ONLY. This is no longer 
permitted.
"""

--
nosy: +inada.naoki

___
Python tracker 

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



[issue37547] Add _PyObject_CallMethodOneArg()

2019-07-18 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset d3952096537d9d2706e10af0c0596daeee6a58c9 by Inada Naoki (Zackery 
Spytz) in branch 'master':
bpo-37547: Fix a compiler warning in winconsoleio.c (GH-14785)
https://github.com/python/cpython/commit/d3952096537d9d2706e10af0c0596daeee6a58c9


--

___
Python tracker 

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



[issue37624] random.choices has unexpected behavior with negative weights

2019-07-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

We can add a note the the docs that weights are assumed to be non-negative, but 
I don't want to add an extra O(n) step to check for unusual inputs with 
undefined meaning -- that would just impair the normal use cases for near zero 
benefit.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
priority: normal -> low

___
Python tracker 

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



[issue31689] random.choices does not work with negative weights

2019-07-18 Thread Aldwin Pollefeyt


Aldwin Pollefeyt  added the comment:

issue37624: not adding an extra O(n) step to check for unusual inputs with 
undefined meaning -- that would just impair the normal use cases for near zero 
benefit.

--
nosy: +aldwinaldwin

___
Python tracker 

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