[issue35186] distutils.command.upload uses deprecated platform.dist with bdist_rpm

2018-12-16 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset 4e80f5cbeaee87a26e49bc9623c92a10e28dbbd9 by Petr Viktorin (Paul 
Ganssle) in branch 'master':
bpo-35186: Remove "built with" comment in setup.py upload (GH-10414)
https://github.com/python/cpython/commit/4e80f5cbeaee87a26e49bc9623c92a10e28dbbd9


--
nosy: +petr.viktorin

___
Python tracker 

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



[issue34916] include sqlite-3.25+ (with window functions)

2018-12-16 Thread Scott Stevens


Scott Stevens  added the comment:

Due to the SQLite "Magellan" bug, I'd suggest this be 3.26+.

Details: https://blade.tencent.com/magellan/index_en.html
See also: https://bugs.python.org/issue35360

--
nosy: +Scott Stevens

___
Python tracker 

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



[issue35360] [Windows] Update SQLite dependency

2018-12-16 Thread Scott Stevens


Scott Stevens  added the comment:

With the discovery of the SQLite "Magellan" bug, could the version be  upgraded 
to 3.26 for all Python versions? As far as I know, the security case is 
restricted to where the user is allowing aribitrary SQL execution without 
arbitrary Python execution, but in that case I do believe remote code execution 
is possible.

https://blade.tencent.com/magellan/index_en.html

--
nosy: +Scott Stevens

___
Python tracker 

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



[issue35514] Docs on reference count detail. enhancement.

2018-12-16 Thread bombs


New submission from bombs :

https://docs.python.org/3/c-api/intro.html#reference-count-details

When I read that section of the docs first time, I found it hard to grasp what 
transferring of ownership is, which is an important and repeating concept 
throughout the docs. Some explanations were confusing. For example,

> When a function passes ownership of a reference on to its caller, the
> caller is said to receive a new reference

This part tries to explain what is to receive a new reference, in terms of 
passing ownership, when readers have no ideas of what transferring of ownership 
is. I think it is kind of a circular definition fallacy.

I think this section should've explained transferring of ownership, a high 
level concept, in terms of reference count changes, which are concrete 
operations.


(original version)
When a function passes ownership of a reference on to its caller, the caller is 
said to receive a new reference. When no ownership is transferred, the caller 
is said to borrow the reference. Nothing needs to be done for a borrowed 
reference.
Conversely, when a calling function passes in a reference to an object, there 
are two possibilities: the function steals a reference to the object, or it 
does not. Stealing a reference means that when you pass a reference to a 
function, that function assumes that it now owns that reference, and you are 
not responsible for it any longer.

(revision)
When a function returns an object and effectively increases the reference count 
of it, the function is said to give ownership of a new reference to its caller. 
When a function returns an object without changing the reference count of it, 
the caller is said to borrow the reference. Nothing needs to be done for a 
borrowed reference.
Conversely, if a function decreases the reference count of an object, it is 
said to steal the ownership of the reference from its owner. Stealing a 
reference means that when you pass a reference to a stealing function, that 
function assumes that it now owns that reference, and you are not responsible 
for it any longer.

--
assignee: docs@python
components: Documentation
messages: 331946
nosy: bluewhale8202, docs@python
priority: normal
severity: normal
status: open
title: Docs on reference count detail. enhancement.
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue35397] Undeprecate and document urllib.parse.unwrap

2018-12-16 Thread Éric Araujo

Éric Araujo  added the comment:

I suspect the only reason was that unwrap was caught in the bag of 
«undocumented functions (that don‘t seem useful)».

Personally I think I see more bare URLs than URLs in angle brackets these days, 
and `URL:` feels like an archaic marker :)  But I don’t see any harm in 
un-deprecating and documenting the function now that you say you would find it 
useful.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue17561] Add socket.create_server_sock() convenience function

2018-12-16 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

Interesting. Yes, I agree this proposal is still desirable. We can reuse 
socket.create_server_sock() in smtpd, ftplib, socketserver (issue20215) and 
http.server (issue24209) modules which will inherit dual-stack IPv4/6 
capabilities for free. I should be able to provide a PR sometime during this 
month.

--
assignee:  -> giampaolo.rodola

___
Python tracker 

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



[issue17561] Add socket.create_server_sock() convenience function

2018-12-16 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I do believe this issue is still important and relevant. See issue25667 for a 
duplicate ticket (and references to implementations) and issue24209 for another 
issue where this could have been applied.

--
nosy: +jason.coombs
versions: +Python 3.8 -Python 3.4

___
Python tracker 

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



[issue25667] Supply dual-stack (IPv4/IPv6) socket bind routine

2018-12-16 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I believe this issue is a duplicate of 17561, which I stumbled onto today.

--
resolution:  -> duplicate
superseder:  -> Add socket.create_server_sock() convenience function

___
Python tracker 

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



[issue35196] IDLE text squeezer is too aggressive and is slow

2018-12-16 Thread Grant Jenks


Change by Grant Jenks :


--
nosy: +grantjenks

___
Python tracker 

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



[issue35412] test_future4 ran no test

2018-12-16 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10422

___
Python tracker 

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



[issue35513] Lib/test/lock_tests.py should not use time.time(), but time.monotonic()

2018-12-16 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10421

___
Python tracker 

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



[issue35491] multiprocessing: enhance repr() to ease debugging

2018-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2dfe3511fe310c559d5571c52dcac381f33fd3a6 by Victor Stinner in 
branch 'master':
bpo-35491, multiprocessing: replace "RUN" with RUN (GH-11178)
https://github.com/python/cpython/commit/2dfe3511fe310c559d5571c52dcac381f33fd3a6


--

___
Python tracker 

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



[issue35513] Lib/test/lock_tests.py should not use time.time(), but time.monotonic()

2018-12-16 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue35499] "make profile-opt" overrides CFLAGS_NODIST

2018-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9a4758550d96030ee7e7f7c7c68b435db1a2a825 by Victor Stinner (Miss 
Islington (bot)) in branch '3.7':
bpo-35499: make profile-opt don't override CFLAGS_NODIST (GH-11164) (GH-11179)
https://github.com/python/cpython/commit/9a4758550d96030ee7e7f7c7c68b435db1a2a825


--

___
Python tracker 

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



[issue35513] Lib/test/lock_tests.py should not use time.time(), but time.monotonic()

2018-12-16 Thread STINNER Victor


New submission from STINNER Victor :

https://buildbot.python.org/all/#/builders/145/builds/956

Unhandled exception in thread started by .task 
at 0x111775cb0>
Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/lock_tests.py",
 line 41, in task
f()
  File 
"/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/lock_tests.py",
 line 591, in f
self.assertTimeout(dt, 0.1)
  File 
"/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/lock_tests.py",
 line 80, in assertTimeout
self.assertGreaterEqual(actual, expected * 0.6)
  File 
"/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/unittest/case.py", 
line 1283, in assertGreaterEqual
self.fail(self._formatMessage(msg, standardMsg))
  File 
"/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/unittest/case.py", 
line 719, in fail
raise self.failureException(msg)
AssertionError: -0.24049997329711914 not greater than or equal to 0.06
test_waitfor_timeout (test.test_threading.ConditionTests) ... FAIL

test_waitfor_timeout():

...
dt = time.time()
result = cond.wait_for(lambda : state==4, timeout=0.1)
dt = time.time() - dt
self.assertFalse(result)
self.assertTimeout(dt, 0.1)
...

with:

def assertTimeout(self, actual, expected):
...
self.assertGreaterEqual(actual, expected * 0.6)
...

It seems like time.time() gone backward on the buildbot. The test must use 
time.monotonic() to measure time difference.

Attached PR fix the issue.

--
components: Tests
messages: 331939
nosy: pablogsal, vstinner
priority: normal
severity: normal
status: open
title: Lib/test/lock_tests.py should not use time.time(), but time.monotonic()
versions: Python 3.8

___
Python tracker 

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



[issue35499] "make profile-opt" overrides CFLAGS_NODIST

2018-12-16 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10419

___
Python tracker 

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



[issue20164] Undocumented KeyError from os.path.expanduser

2018-12-16 Thread STINNER Victor


STINNER Victor  added the comment:

Even if it's not exactly a duplicate of bpo-10496, the reported bug has been 
fixed. I close the issue.

--
resolution:  -> duplicate
stage: test needed -> resolved
status: pending -> closed
superseder:  -> Python startup should not require passwd entry

___
Python tracker 

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



[issue35491] multiprocessing: enhance repr() to ease debugging

2018-12-16 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10418

___
Python tracker 

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



[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2018-12-16 Thread Jason R. Coombs


New submission from Jason R. Coombs :

Originally [reported in 
testing-cabal/mock#405](https://github.com/testing-cabal/mock/issues/405), I 
believe I've discovered an inconsistency that manifests as a flaw:

`patch` and `patch.object` allow the target to be specified as string referring 
to the target object and this object is resolved at the time the patch 
effected, not when the patch is declared. `patch.dict` contrarily seems to 
resolve the dict eagerly, when the patch is declared. Observe with this pytest:

```
import mock


target = dict(a=1)

@mock.patch.dict('test_patch_dict.target', dict(b=2))
def test_after_patch():
assert target == dict(a=2, b=2)

target = dict(a=2)
```

Here's the output:

```
$ rwt mock pytest -- -m pytest test_patch_dict.py
Collecting mock
  Using cached mock-2.0.0-py2.py3-none-any.whl
Collecting pbr>=0.11 (from mock)
  Using cached pbr-3.0.0-py2.py3-none-any.whl
Collecting six>=1.9 (from mock)
  Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: pbr, six, mock
Successfully installed mock-2.0.0 pbr-3.0.0 six-1.10.0
== test session starts 
===
platform darwin -- Python 3.6.1, pytest-3.0.5, py-1.4.33, pluggy-0.4.0
rootdir: /Users/jaraco, inifile: 
collected 1 items 

test_patch_dict.py F

 FAILURES 

 test_after_patch 


@mock.patch.dict('test_patch_dict.target', dict(b=2))
def test_after_patch():
>   assert target == dict(a=2, b=2)
Eassert {'a': 2} == {'a': 2, 'b': 2}
E  Omitting 1 identical items, use -v to show
E  Right contains more items:
E  {'b': 2}
E  Use -v to get the full diff

test_patch_dict.py:8: AssertionError
 1 failed in 0.05 seconds 

```

The target is unpatched because `test_patch_dict.target` was resolved during 
decoration rather than during test run.

Removing the initial assignment of `target = dict(a=1)`, the failure is thus:

```
__ ERROR collecting test_patch_dict.py 
___
ImportError while importing test module '/Users/jaraco/test_patch_dict.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/rwt-pcm3552g/mock/mock.py:1197:
 in _dot_lookup
return getattr(thing, comp)
E   AttributeError: module 'test_patch_dict' has no attribute 'target'

During handling of the above exception, another exception occurred:
:942: in _find_and_load_unlocked
???
E   AttributeError: module 'test_patch_dict' has no attribute '__path__'

During handling of the above exception, another exception occurred:
test_patch_dict.py:4: in 
@mock.patch.dict('test_patch_dict.target', dict(b=2))
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/rwt-pcm3552g/mock/mock.py:1708:
 in __init__
in_dict = _importer(in_dict)
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/rwt-pcm3552g/mock/mock.py:1210:
 in _importer
thing = _dot_lookup(thing, comp, import_path)
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/rwt-pcm3552g/mock/mock.py:1199:
 in _dot_lookup
__import__(import_path)
E   ModuleNotFoundError: No module named 'test_patch_dict.target'; 
'test_patch_dict' is not a package
 Interrupted: 1 errors during collection 
!
 1 error in 0.41 seconds 
=
```

Is there any reason `patch.dict` doesn't have a similar deferred resolution 
behavior as its sister methods?

--
components: Library (Lib)
messages: 331937
nosy: jason.coombs
priority: normal
severity: normal
status: open
title: patch.dict resolves in_dict eagerly (should be late resolved)

___
Python tracker 

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



[issue35496] left-to-right violation in match order

2018-12-16 Thread Steve Newcomb


Steve Newcomb  added the comment:

I'm very grateful for your time and attention, and sorry to have distracted 
you.  You're correct when you say:  

Steven D'Aprano: ...the rightmost alternative matches from position 1 of the 
text, while the leftmost alternative doesn't match until position 8. So 
starting from position 0, the IPV6 check matches first, and so wins.

I see now that what I was trying to do is simply not possible. I was looking 
for a way to do a kind of hat trick: to keep a matched substring (":::") 
out of matchObject.group(0).  I guess I just don't get to do that.  

It would be a nice feature to add: a "consume-and-forget" or "suppress" 
extension group type. Non-capturing groups forget about themselves, but they 
don't suppress their matched contents.  It's a nice thing to be able to do 
because some software accepts regular expressions as configuration items but 
doesn't allow configuration of selection among the groups that may appear 
within it.  (I admit there aren't many occasions when suppression of substrings 
from group(0) is really necessary, but I think they do occur.)

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



[issue35511] Some methods of profile.Profile are not supported but the docs doesn't mention it.

2018-12-16 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue35511] Some methods of profile.Profile are not supported but the docs doesn't mention it.

2018-12-16 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset b912f9342e7a37d170ba659c13c959115c11545a by Andrew Svetlov 
(Beomsoo Kim) in branch 'master':
bpo-35511: Trivial docs updates for profile and resource library modules. 
(GH-11124)
https://github.com/python/cpython/commit/b912f9342e7a37d170ba659c13c959115c11545a


--

___
Python tracker 

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



[issue35507] multiprocessing: seg fault when creating RawArray from numpy ctypes

2018-12-16 Thread Anthony Sottile


Anthony Sottile  added the comment:

This appears to be a bug with numpy, I've made a PR for them: 
https://github.com/numpy/numpy/pull/12566

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue34864] In Idle, Mac tabs make editor status line disappear.

2018-12-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Ned, the warning is non-specific as to what might go wrong.  I would not want 
to remove it until I had tested everything possibly relevant with tabbing set.  
And there is still the possibility that people will run IDLE with earlier tk 
releases.

The #33397 issue of the close button disappearing was solved by packing the 
close button first.  In the editor, the status bar is already packed into the 
ListedTopLevel first, before the text frame (perhaps for the same reason).

--

___
Python tracker 

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



[issue16516] argparse types (and actions) must be hashable

2018-12-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

Luna discovered that has actually been fixed in 3.8 (i.e. the master branch), 
by making {}.get hashable. So I'm closing this as fixed.

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



[issue25430] speed up ipaddress __contain__ method

2018-12-16 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Though this is out of the scope of the issue I tried converting num_addresses, 
__hash__, __getitem__ and __eq__ as per Serhiy's idea for IPv6Network replacing 
the stdlib implementation's int calls with _ip in a custom class. I can see up 
to 50% speedups as below and no test case failures converting rest of the call 
sites to use _ip instead of int in stdlib. But some of the methods may not be 
used as frequently as in this benchmark like thus being not worthy enough of 
change. Shall I open a new issue for further discussion? 

$ python3.7 bpo25430_1.py

ipv6 test num_addresses with int 1.54065761
ipv6 test num_addresses without int 0.826636081998
ipv6 test hash with int 1.320016881
ipv6 test hash without int 0.626632320001
ipv6 test equality with int 1.610400199008
ipv6 test equality without int 1.037488539008
ipv6 test get item with int 2.09234339001
ipv6 test get item without int 1.560667341003

$ bpo25430_1.py

import ipaddress
import timeit

class IPv6Network2(ipaddress.IPv6Network):

@property
def num_addresses(self):
return self.broadcast_address._ip - self.network_address._ip + 1

def __hash__(self):
return hash(self.network_address._ip ^ self.netmask._ip)

def __eq__(self, other):
try:
return (self._version == other._version and
self.network_address == other.network_address and
self.netmask._ip == other.netmask._ip)
except AttributeError:
return NotImplemented

def __getitem__(self, n):
network = self.network_address._ip
broadcast = self.broadcast_address._ip
if n >= 0:
if network + n > broadcast:
raise IndexError('address out of range')
return self._address_class(network + n)
else:
n += 1
if broadcast + n < network:
raise IndexError('address out of range')
return self._address_class(broadcast + n)


ipv6_test_net = ipaddress.IPv6Network("::/0")
ipv6_test_net2 = IPv6Network2("::/0")

def test1_num_address():
return ipv6_test_net.num_addresses

def test2_num_address():
return ipv6_test_net2.num_addresses

def test1_hash_address():
return hash(ipv6_test_net)

def test2_hash_address():
return hash(ipv6_test_net2)

if __name__ == "__main__":
t = timeit.Timer("test1_num_address()", "from __main__ import 
test1_num_address")
print("ipv6 test num_addresses with int", t.timeit(number=100))

t = timeit.Timer("test2_num_address()", "from __main__ import 
test2_num_address")
print("ipv6 test num_addresses without int", t.timeit(number=100))

t = timeit.Timer("test1_hash_address()", "from __main__ import 
test1_hash_address")
print("ipv6 test hash with int", t.timeit(number=100))

t = timeit.Timer("test2_hash_address()", "from __main__ import 
test2_hash_address")
print("ipv6 test hash without int", t.timeit(number=100))

t = timeit.Timer("ipv6_test_net == ipv6_test_net", "from __main__ import 
ipv6_test_net")
print("ipv6 test equality with int", t.timeit(number=100))

t = timeit.Timer("ipv6_test_net2 == ipv6_test_net2", "from __main__ import 
ipv6_test_net2")
print("ipv6 test equality without int", t.timeit(number=100))

t = timeit.Timer("ipv6_test_net[1]", "from __main__ import 
ipv6_test_net")
print("ipv6 test get item with int", t.timeit(number=100))

t = timeit.Timer("ipv6_test_net2[1]", "from __main__ import 
ipv6_test_net2")
print("ipv6 test get item without int", t.timeit(number=100))

assert test1_num_address() == test2_num_address()
assert hash(ipv6_test_net2) == hash(ipv6_test_net)
assert ipv6_test_net2 == ipv6_test_net
assert ipv6_test_net[1] == ipv6_test_net2[1]

--
nosy: +xtreak

___
Python tracker 

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



[issue35499] "make profile-opt" overrides CFLAGS_NODIST

2018-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 640ed520dd6a43a8bf470b79542f58b5d57af9de by Victor Stinner in 
branch 'master':
bpo-35499: make profile-opt don't override CFLAGS_NODIST (GH-11164)
https://github.com/python/cpython/commit/640ed520dd6a43a8bf470b79542f58b5d57af9de


--

___
Python tracker 

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



[issue21041] pathlib.PurePath.parents rejects negative indexes

2018-12-16 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue35509] Unable to inherit from logging.Formatter

2018-12-16 Thread Chih-Hsuan Yen


Chih-Hsuan Yen  added the comment:

Hi Vinay Sajip, thanks for notifying the patch author. Just a question: is 
there a reason to remove 3.8 from affected versions? My sample program is 
indeed broken on Python 3.8.

--

___
Python tracker 

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



[issue35510] pickling derived dataclasses

2018-12-16 Thread Satrajit S Ghosh


Satrajit S Ghosh  added the comment:

Thank you.

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



[issue35510] pickling derived dataclasses

2018-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Dataclasses are pickled by name, as well as other classes. Pickling classes 
which can not be accessed by name is not supported.

--

___
Python tracker 

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



[issue35510] pickling derived dataclasses

2018-12-16 Thread Satrajit S Ghosh


Satrajit S Ghosh  added the comment:

thank you + serhiy.storchaka

while that works in an interactive namespace, it fails in the following 
setting, which is closer to my dynamic use case.

```
class A:
def __init__(self, fields=None):
self.B = dc.make_dataclass('B', fields or [])
self.B.__module__ = __name__
# ...
self.C = self.B()
```

now pickling A() fails.

--

___
Python tracker 

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



[issue22166] test_codecs leaks references

2018-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Do you mind to create a PR Victor?

--

___
Python tracker 

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



[issue22166] test_codecs leaks references

2018-12-16 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
versions: +Python 3.7, Python 3.8 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue20164] Undocumented KeyError from os.path.expanduser

2018-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The behavior was changed in f2f4555d8287ad217a1dba7bbd93103ad4daf3a8 as a part 
of issue10496.

--
nosy: +serhiy.storchaka, vstinner
status: open -> pending

___
Python tracker 

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



[issue21041] pathlib.PurePath.parents rejects negative indexes

2018-12-16 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: behavior -> enhancement
versions: +Python 3.8 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue35498] Parents objects in pathlib.Path don't support slices as __getitem__ arguments

2018-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See also issue21041. First than add support for slices, we should make a 
decision about negative indices.


In any case this is a new feature, which can be only added in the future 3.8 
release.

--
dependencies: +pathlib.PurePath.parents rejects negative indexes
nosy: +serhiy.storchaka
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



[issue35509] Unable to inherit from logging.Formatter

2018-12-16 Thread Vinay Sajip


Change by Vinay Sajip :


--
nosy: +BNMetrics
versions: +Python 3.6 -Python 3.8

___
Python tracker 

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



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2018-12-16 Thread Eryk Sun


Eryk Sun  added the comment:

> what is the problem with getting False for bind mounts 
> on the same filesystem?

Probably there's no problem if it's consistently false for all bind mounts on 
the same file system, but ismount() is true for a bind mount to the parent 
directory on the same file system, since the inodes match.

--

___
Python tracker 

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



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2018-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I do not think that we should use /proc/mounts or getmntent ,because they are 
not portable. os.path.ismount() uses the traditional way to detect mountpoints 
which is not able to detect bind mounts.

But what is the problem with getting False for bind mounts on the same 
filesystem?

--

___
Python tracker 

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



[issue31855] mock_open is not compatible with read(n) (and pickle.load)

2018-12-16 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Internally mock_open implementation uses line based iteration [0] to keep track 
of the state change between read calls. So readline too ignores the argument. 
There is issue25690 for an alternate mock_open implementation but the code 
change is large and adds a lot of features. A simpler approach would be to use 
StringIO or BytesIO to keep track of state changes and they provide read, 
readline and readlines API. mock_open docs mentions about using a customized 
mock for complex cases but I don't know if worthy enough to make this 
enhancement given the internal implementation change to support the API or to 
document this behavior. 

Looking further there also seems to be a test case for it [1] which will fail 
if this is fixed since this returns all characters instead of first 10 like 
using open().read(10).


def test_mock_open_read_with_argument(self):
# At one point calling read with an argument was broken
# for mocks returned by mock_open
some_data = 'foo\nbar\nbaz'
mock = mock_open(read_data=some_data)
self.assertEqual(mock().read(10), some_data)


$ echo -n 'foo\nbar\nbaz' > /tmp/a.txt
$ ./python.exe
Python 3.8.0a0 (heads/master:f5107dfd42, Dec 16 2018, 13:41:57)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> with open('/tmp/a.txt') as f:
... actual = f.read(10)
... actual, len(actual)
...
('foo\nbar\nba', 10)
>>> with open('/tmp/a.txt') as f:
... from unittest.mock import mock_open
... mock = mock_open(read_data=f.read())
... mock_data = mock().read(10)
... mock_data, len(mock_data)
...
('foo\nbar\nbaz', 11)


[0] 
https://github.com/python/cpython/blob/f5107dfd42121ef40b13eb678705802f0ff02cf9/Lib/unittest/mock.py#L2349
[1] 
https://github.com/python/cpython/blob/f5107dfd42121ef40b13eb678705802f0ff02cf9/Lib/unittest/test/testmock/testwith.py#L284

--
nosy: +cjw296, mariocj89, xtreak
versions: +Python 3.7, 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