[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2019-02-13 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +11867

___
Python tracker 

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



[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-13 Thread Tal Einat


Tal Einat  added the comment:

Susan, I agree that similarly improving the failure message for 
assert_called_with would be good.

I find the final "Not called" line unclear, though. Perhaps something like the 
following:

AssertionError: expected call not found.
Expected: mock(1, 2, 3, 4)
Actual: Not called

--

___
Python tracker 

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



[issue35982] Create unit-tests for os.renames()

2019-02-13 Thread Joannah Nanjekye


New submission from Joannah Nanjekye :

In a discussion to fix https://bugs.python.org/issue35951, @giampaolo.rodola 
pointed out that there are no tests for os.renames()

I have opened this issue to track this.

--
messages: 335395
nosy: nanjekyejoannah
priority: normal
severity: normal
status: open
title: Create unit-tests for os.renames()

___
Python tracker 

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



[issue35981] shutil make_archive create wrong file when base name contains dots at end

2019-02-13 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

I have just tried with 3.7.2 and I don't get your error.

Python 3.7.2 (default, Jan 16 2019, 19:49:22) 
[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> import os
>>> shutil.make_archive('demo...bar..', 'zip', os.path.abspath('/tmp/demo'))
'/tmp/demo/demo...bar...zip'
>>> 

ls -l /tmp/demo
-rw-r--r--. 1 stephane stephane 226 13 fév 10:45 demo...bar...zip

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



[issue35981] shutil make_archive create wrong file when base name contains dots at end

2019-02-13 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Is this Windows specific? I am unable to reproduce this on Mac and Ubuntu with 
master and Python 3.7 .

➜  cpython git:(master) ./python.exe -c 'import os, shutil; 
shutil.make_archive("foo...bar..", "zip", os.path.abspath("./Tools"))'
➜  cpython git:(master) ✗ ls foo...bar...zip
foo...bar...zip
➜  cpython git:(master) ✗ rm foo...bar...zip
➜  cpython git:(master) python3.7 -c 'import os, shutil; 
shutil.make_archive("foo...bar..", "zip", os.path.abspath("./Tools"))'
➜  cpython git:(master) ✗ ls foo...bar...zip
foo...bar...zip

--
nosy: +xtreak

___
Python tracker 

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



[issue35951] os.renames() creates directories if original name doesn't exist

2019-02-13 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

@giampaolo.rodola thanks for insight on tests. I dint catch that at all :)

I am working on tests for os.renames() I opened an issue to track that here : 
https://bugs.python.org/issue35982.

IMHO, I think we need to improve the current behavior.

This discussion is not yet conclusive. You pointed out that this fix makes the 
problem a lot less likely to occur but we may end up with a race condition.

Can we close this PR so that maybe someone comes with a fix that addresses both 
problems? can we work with this fix? Am happy to comply with any decision. cc 
@vstinner

Once we agree on this, I will make necessary changes also in the review of this 
PR.

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue35982] Create unit-tests for os.renames()

2019-02-13 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

good catch

--
nosy: +matrixise

___
Python tracker 

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



[issue35982] Create unit-tests for os.renames()

2019-02-13 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

I am working on this.

--

___
Python tracker 

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



[issue35982] Create unit-tests for os.renames()

2019-02-13 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

ok, I was working on this issue.

--

___
Python tracker 

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



[issue35982] Create unit-tests for os.renames()

2019-02-13 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

You can check this branch, but I have not created the PR because you were 
working on this issue.

https://github.com/matrixise/cpython/commit/3f23deceef423b038273d28080d4aaee664b6bc9

--

___
Python tracker 

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



[issue35982] Create unit-tests for os.renames()

2019-02-13 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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

___
Python tracker 

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



[issue35982] Create unit-tests for os.renames()

2019-02-13 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

ok, I have created a PR, you can comment it and we can work together on this PR.

Have a nice day,

Stéphane

--
stage: patch review -> 

___
Python tracker 

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



[issue35900] Add pickler hook for the user to customize the serialization of user defined functions and types.

2019-02-13 Thread Olivier Grisel


Olivier Grisel  added the comment:

Adding such a hook would make it possible to reimplement 
cloudpickle.CloudPickler by deriving from the fast _pickle.Pickler class 
(instead of the slow pickle._Pickler as done currently). This would mean 
rewriting most of the CloudPickler method to only rely on a save_reduce-style 
design instead of directly calling pickle._Pickler.write and 
pickle._Pickler.save. This is tedious but doable.

There is however a blocker with the current way closures are set: when we 
pickle a dynamically defined function (e.g. lambda, nested function or function 
in __main__), we currently use a direct call to memoize 
(https://github.com/cloudpipe/cloudpickle/blob/v0.7.0/cloudpickle/cloudpickle.py#L594)
 so as to be able to refer to the function itself in its own closure without 
causing an infinite loop in CloudPickler.dump. This also makes possible to 
pickle mutually recursive functions.

The easiest way to avoid having to call memoize explicitly would be to be able 
to pass the full __closure__ attribute in the state dict of the reduce call. 
Indeed the save_reduce function calls memoize automatically after saving the 
reconstructor and its args but prior to saving the state:

https://github.com/python/cpython/blob/v3.7.2/Modules/_pickle.c#L3903-L3931

It would therefore be possible to pass a (state, slotstate) tuple with the 
closure in slotstate that so it could be reconstructed at unpickling time with 
a setattr:

https://github.com/python/cpython/blob/v3.7.2/Modules/_pickle.c#L6258-L6272

However, it is currently not possible to setattr __closure__ at the moment. We 
can only set individual closure cell contents (which is not compatible with the 
setattr state trick described above).

To summarize, we need to implement the setter function for the __closure__ 
attribute of functions and methods to make it natural to reimplement the 
CloudPickler by inheriting from _pickle.Pickler using the hook described in 
this issue.

--
nosy: +Olivier.Grisel

___
Python tracker 

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



[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

2019-02-13 Thread Jeroen Demeyer


New submission from Jeroen Demeyer :

When designing an extension type subclassing an existing type, it makes sense 
to call the tp_dealloc of the base class from the tp_dealloc of the subclass.

Now suppose that I'm subclassing "list" which uses the trashcan mechanism. Then 
it can happen that the tp_dealloc of list puts this object in the trashcan, 
even though the tp_dealloc of the subclass has already been called. Then the 
tp_dealloc of the subclass may be called multiple times, which is unsafe 
(tp_dealloc is expected to be called exactly once).

To solve this, the trashcan mechanism should be disabled when tp_dealloc is 
called from a subclass.

Interestingly, subtype_dealloc also solves this in a much more involved way 
(see the "Q. Why the bizarre (net-zero) manipulation of 
_PyRuntime.trash_delete_nesting around the trashcan macros?") in 
Objects/typeobject.c

--
components: Interpreter Core
messages: 335405
nosy: jdemeyer, pitrou, scoder
priority: normal
severity: normal
status: open
title: tp_dealloc trashcan shouldn't be called for subclasses
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



[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

2019-02-13 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Jeroen, could you share your example? I am learning the C-API of Python and 
this example could be interesting.

--
nosy: +matrixise

___
Python tracker 

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



[issue35982] Create unit-tests for os.renames()

2019-02-13 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi Giampaolo,

I added you to this issue, about the tests, I have created a very simple test 
but I would like to know your advice.

Thank you,

--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue35984] test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=1

2019-02-13 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

The reafleak buildbots have detected memory block leaks in 
test__xxsubinterpreters:

Ran 112 tests in 4.721s
OK (skipped=5)
.
test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=10
1 test failed again:
test__xxsubinterpreters
== Tests result: FAILURE then FAILURE ==


https://buildbot.python.org/all/#/builders/1/builds/502
https://buildbot.python.org/all/#/builders/80/builds/511

Bisecting shows 16f842da3c862d76a1177bd8ef9579703c24fa5a is the first bad 
commit. This was introduced in PR11822.

--
components: Tests
messages: 335408
nosy: eric.snow, pablogsal, vstinner
priority: normal
severity: normal
status: open
title: test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=1
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



[issue35984] test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=1

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

> Bisecting shows 16f842da3c862d76a1177bd8ef9579703c24fa5a is the first bad 
> commit. This was introduced in PR11822.

That's issue bpo-35972.

--

___
Python tracker 

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



[issue35972] _xxsubinterpreters: channel_send() may truncate ints on 32-bit platforms

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

> New changeset 16f842da3c862d76a1177bd8ef9579703c24fa5a by Eric Snow (Alexey 
> Izbyshev) in branch 'master':
> bpo-35972: _xxsubinterpreters: Fix potential integer truncation on 32-bit in 
> channel_send() (gh-11822)

It seems like this change introduced a reference leak: bpo-35984.

--

___
Python tracker 

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



[issue35984] test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=1

2019-02-13 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +izbyshev

___
Python tracker 

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



[issue35984] test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=1

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

$ ./python -m test.bisect_cmd -R 3:3 test__xxsubinterpreters 

found:

test.test__xxsubinterpreters.ShareableTypeTests.test_non_shareable_int

--

___
Python tracker 

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



[issue35984] test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=1

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

I'm mentoring Alexey Izbyshev.

@Alexey: Do you want to work on this issue?

--

___
Python tracker 

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



[issue35982] Create unit-tests for os.renames()

2019-02-13 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

If you have created a PR, that is fine. Am not able to look now though may be 
later.

--

___
Python tracker 

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



[issue35984] test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=1

2019-02-13 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

I'll look into it later today. An obvious guess is that my test simply exposed 
an existing leak because the exception code path wasn't tested before AFAIK, 
but I need to check it.

--
assignee:  -> izbyshev

___
Python tracker 

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



[issue18283] shutil.which() should support bytes

2019-02-13 Thread STINNER Victor


Change by STINNER Victor :


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



[issue18283] shutil.which() should support bytes

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5680f6546dcda550ad70eefa0a5ebf1375303307 by Victor Stinner 
(Cheryl Sabella) in branch 'master':
bpo-18283: Add support for bytes to shutil.which (GH-11818)
https://github.com/python/cpython/commit/5680f6546dcda550ad70eefa0a5ebf1375303307


--

___
Python tracker 

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



[issue35961] test_slice: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset dcb68f47f74b0cc8a1896d4a4c5a6b83c0bbeeae by Victor Stinner in 
branch 'master':
bpo-35961: Fix a crash in slice_richcompare() (GH-11830)
https://github.com/python/cpython/commit/dcb68f47f74b0cc8a1896d4a4c5a6b83c0bbeeae


--

___
Python tracker 

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



[issue35961] test_slice: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small

2019-02-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11869

___
Python tracker 

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



[issue35961] test_slice: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

Python 2.7 is not affected: it doesn't have the slice_richcompare() function, 
but the old slice_compare() implementation.

Python 3.6 is affected but doesn't accept bugfixes anymore: 
https://devguide.python.org/#status-of-python-branches This bug is 13 years 
old, I don't think that it's really useful to fix it. It mostly impact 
test_slice and only test_slice.

--
versions:  -Python 3.6

___
Python tracker 

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



[issue35961] test_slice: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

> This bug is 13 years old, I don't think that it's really useful to fix it. It 
> mostly impact test_slice and only test_slice.

To be clear, I compiled Python 3.6 in release mode and applied test_slice patch 
of msg335333: no crash after 1500 runs. The bug is an assertion error, but 
assertions are only compiled in debug mode.

--

___
Python tracker 

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



[issue35810] Object Initialization does not incref Heap-allocated Types

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

> * Should I write something up in python-dev/Discourse?

Please open a thread on python-dev. The purpose is not really to ask if it's 
worth it, but more to communicate properly on backward incompatible changes.

> * Do I need to update the PY_VERSION_HEX?

No. The release manager is responsible for that.

> * Do I need to write an entry in the Porting guide?

Yes. You should add a new "Changes in the C API" section to:
https://docs.python.org/dev/whatsnew/3.8.html#porting-to-python-3-8

This is why you can show an example of dealloc using #ifdef with PY_VERSION_HEX.

Example in 3.7 doc:
https://docs.python.org/dev/whatsnew/3.7.html#changes-in-the-c-api

--

___
Python tracker 

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



[issue35984] test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=1

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

> I'll look into it later today. An obvious guess is that my test simply 
> exposed an existing leak because the exception code path wasn't tested before 
> AFAIK, but I need to check it.

Right. I don't think that your change introduced a regression.

--

___
Python tracker 

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



[issue35961] test_slice: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small

2019-02-13 Thread miss-islington


miss-islington  added the comment:


New changeset a78251e2d6de37f46c230be924032a87df730761 by Miss Islington (bot) 
in branch '3.7':
bpo-35961: Fix a crash in slice_richcompare() (GH-11830)
https://github.com/python/cpython/commit/a78251e2d6de37f46c230be924032a87df730761


--
nosy: +miss-islington

___
Python tracker 

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



[issue35981] shutil make_archive create wrong file when base name contains dots at end

2019-02-13 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Could be the case that it's windows specific. For "foo...bar..." abspath 
returns "foo...bar..." in Python on Mac. I don't have access to Windows but 
checking this on dotnet fiddle with C# which I hope uses Windows full path 
strips out the leading dots which I think could be a case with os.path.abspath 
used in make_archive.

Sample fiddle : https://dotnetfiddle.net/PhRr98.

--

___
Python tracker 

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



[issue35961] test_slice: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks everyone for helping on the analysis and for reviews obviously.

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



[issue35985] Folding tries to slice from 0 to float("+inf") when maxlength is 0

2019-02-13 Thread Lukas J


New submission from Lukas J :

When converting an email.message.Message with the policy set to 
email.policy.EmailPolicy with all default settings, I eventually end up with 
this exception:



  File "/usr/lib/python3.7/email/_header_value_parser.py", line 2727, in 
_fold_as_ew
first_part = to_encode[:text_space]
TypeError: slice indices must be integers or None or have an __index__ method



Which is caused because text_space is a float of value +inf. This is set  on 
line 2594 of the same file: maxlen = policy.max_line_length or float("+inf")

For some reason policy.max_line_length is set to zero, even though the default 
should be 78 after a glance into the source.


So there's maybe even two issues: 

1.) The fallback for maxlen shouldn't be float("+inf"), as that is not an 
integer and thus can't be sliced by. I think a big integer would suffice 
instead, for example 1

2.) policy.max_line_length seems to lose it's value in the default settings 
somewhere along the way if it isn't explicitly set.


Current workaround:
Set max_line_length of the policy to a value (78 is default)

--
components: email
messages: 335424
nosy: Lukas J, barry, r.david.murray
priority: normal
severity: normal
status: open
title: Folding tries to slice from 0 to float("+inf") when maxlength is 0
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



[issue35985] Folding tries to slice from 0 to float("+inf") when maxlength is 0

2019-02-13 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This seems to be same as issue33524 ?

--
nosy: +xtreak

___
Python tracker 

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



[issue35985] Folding tries to slice from 0 to float("+inf") when maxlength is 0

2019-02-13 Thread Lukas J


Lukas J  added the comment:

Indeed it is. Sorry I didn't find it before.

So it seems that changing float("+inf") to sys.maxsize would solve the problem? 
I've tried it in an interactive shell:

>>> a = "asd"; import sys
>>> a[:sys.maxsize]
'asd'

--

___
Python tracker 

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



[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-13 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
keywords: +patch
pull_requests: +11870
stage: needs patch -> patch review

___
Python tracker 

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



[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-13 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi,

I have created the PR for Maxwell.

After tomorrow, if we have no news from him, I propose to you to update/comment 
the PR. Of course, I will add a co-authored-by field in the commit.

--
keywords:  -patch
nosy: +matrixise
stage: patch review -> needs patch

___
Python tracker 

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



[issue35986] print() documentation typo?

2019-02-13 Thread 李笑来

New submission from 李笑来 :

print(), default value sep, should be ' '(one space), rather than an empty str, 
''.

--
assignee: docs@python
components: Documentation
messages: 335428
nosy: docs@python, 李笑来
priority: normal
severity: normal
status: open
title: print() documentation typo?
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue35986] print() documentation typo?

2019-02-13 Thread 李笑来

李笑来  added the comment:

sep argument default value should be ' '(a space), rather than ''(an empty 
string).

--
resolution:  -> remind

___
Python tracker 

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



[issue35985] Folding tries to slice from 0 to float("+inf") when maxlength is 0

2019-02-13 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Could you share your example?

Thank you

--
nosy: +matrixise

___
Python tracker 

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



[issue35985] Folding tries to slice from 0 to float("+inf") when maxlength is 0

2019-02-13 Thread Lukas J

Lukas J  added the comment:

Minimal example:


import email.policy
import email.mime.text

responsehtml = "somehtmlbody"

msg = email.mime.text.MIMEText(responsehtml, "html", 
policy=email.policy.EmailPolicy())

msg["to"] = "t...@example.com"
msg["cc"] = "äöü "
msg["From"] = "f...@bar.com"
msg["Subject"] = "test"

msg.as_string()

--

___
Python tracker 

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



[issue35985] Folding tries to slice from 0 to float("+inf") when maxlength is 0

2019-02-13 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the confirmation. I would propose closing this as a duplicate. The 
PR on the other issue might fix your issue and is just waiting on a NEWS entry.

--

___
Python tracker 

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



[issue35985] Folding tries to slice from 0 to float("+inf") when maxlength is 0

2019-02-13 Thread Lukas J


Lukas J  added the comment:

Ok thank you!

--
resolution:  -> duplicate
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



[issue35986] print() documentation typo?

2019-02-13 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Which documentation are you referring to?

The docstring says:

print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)

which is clearly a space. The docs here:

https://docs.python.org/3/library/functions.html#print

say something very similar:

print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)

but it is really hard to see the space on the website unless you look very 
carefully, because the font used is a proportional font instead of a monospaced 
font. So the space shown is a tiny little sliver of whitespace.

But if you copy and paste the function signature into your text editor, or 
somewhere you can set the font to use a fixed-width programmers font, you will 
see that there definitely is a space there.

So not a typo, but possibly a poor choice of font. It might be nice to rethink 
the choice of font for parameter lists.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue35985] Folding tries to slice from 0 to float("+inf") when maxlength is 0

2019-02-13 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Just add the link to the other issue: https://bugs.python.org/issue33524

--

___
Python tracker 

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



[issue33524] non-ascii characters in headers causes TypeError on email.policy.Policy.fold

2019-02-13 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

See this issue as a duplicata of this one:

https://bugs.python.org/issue35985

--
nosy: +matrixise

___
Python tracker 

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



[issue35985] Folding tries to slice from 0 to float("+inf") when maxlength is 0

2019-02-13 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
superseder:  -> non-ascii characters in headers causes TypeError on 
email.policy.Policy.fold

___
Python tracker 

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



[issue35224] PEP 572: Assignment Expressions

2019-02-13 Thread Miro Hrončok

Miro Hrončok  added the comment:

PEP 572 is nowhere to be found in https://docs.python.org/3.8/whatsnew/3.8.html

Should I open a separate issue for that?

--
nosy: +hroncok

___
Python tracker 

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



[issue35224] PEP 572: Assignment Expressions

2019-02-13 Thread Miro Hrončok

Miro Hrončok  added the comment:

(I've somehow missed the previous comments about the same, sorry about that.)

--

___
Python tracker 

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



[issue35987] Mypy and Asyncio import cannot be skipped

2019-02-13 Thread Samuel GIFFARD


New submission from Samuel GIFFARD :

Some modules cannot be found with mypy. And cannot be silenced/skipped by mypy.

Have the following 3 files:

##
# example1.py
from asyncio import BaseEventLoop  # Module 'asyncio' has no attribute 
'BaseEventLoop'
from asyncio import Semaphore  # OK
import aiostream  # gets skipped correctly
import asyncio  # OK
asyncio.windows_events.WindowsProactorEventLoopPolicy()  # Module has no 
attribute 'windows_events'
asyncio.WindowsProactorEventLoopPolicy()  # Module has no attribute 
'WindowsProactorEventLoopPolicy'

##
# mypy.ini
[mypy]
python_version = 3.7

[mypy-asyncio,aiostream]
follow_imports = skip
ignore_missing_imports = True

##
# Pipfile
[[source]]
url = "https://pypi.org/simple";
verify_ssl = true
name = "pypi"

[dev-packages]

[packages]
mypy = "==0.670"
aiostream = "==0.3.1"

[requires]
python_version = "3.7"

##
$> pipenv install
#...
$> pipenv run python -m mypy --config-file mypy.ini example1.py
example1.py:1: error: Module 'asyncio' has no attribute 'BaseEventLoop'
example1.py:5: error: Module has no attribute "windows_events"
example1.py:6: error: Module has no attribute "WindowsProactorEventLoopPolicy"


Why Semaphore (and others) works and BaseEventLoop (among others) doesn't 
work... no idea.
But it completely breaks mypy that it somehow cannot be skipped nor silenced.

--
components: asyncio
messages: 335439
nosy: Samuel GIFFARD, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Mypy and Asyncio import cannot be skipped
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



[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

2019-02-13 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

The problem is easily reproduced with Cython:

cdef class List(list):
cdef int deallocated

def __dealloc__(self):
if self.deallocated:
print("Deallocated twice!")
self.deallocated = 1

L = None
for i in range(10**4):
L = List((L,))
del L

--

___
Python tracker 

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



[issue35987] Mypy and Asyncio import cannot be skipped

2019-02-13 Thread Samuel GIFFARD


Samuel GIFFARD  added the comment:

I've created a similar ticket on mypy side: 
https://github.com/python/mypy/issues/6383 as I'm not sure where this belongs 
to.

--

___
Python tracker 

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



[issue12374] Execution model should explain compile vs definition vs execution time

2019-02-13 Thread Nick Coghlan


Nick Coghlan  added the comment:

Cheryl has started the conversion process for the old user reference manuscript 
[1], so I think it makes sense to mark this as "postponed" for now, until we 
see how far we can get with this more usage-centric level of explanation as a 
separate project from the language reference.

[1] https://github.com/ncoghlan/python-userref/tree/master/converted

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



[issue35986] print() documentation typo?

2019-02-13 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

@steven 

I have a solution with a css selector if we update the python-docs theme for 
Sphinx.

You can check my screenshot

--
nosy: +matrixise
Added file: https://bugs.python.org/file48136/print_screenshot.png

___
Python tracker 

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



[issue35987] Mypy and Asyncio import cannot be skipped

2019-02-13 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. mypy is not part of stdlib and it seems that typeshed 
doesn't have BaseEventLoop defined in asyncio.__init__.pyi [0] . Adding it to 
the import removes the error . I guess this needs to be filed in typeshed. 
There is an issue open for missing asyncio top level functions at 
https://github.com/python/typeshed/issues/2313 . I would propose closing this 
as third party. I am adding mypy devs as a confirmation and to follow up the 
issue with typeshed for updating stub files.


[0] 
https://github.com/python/typeshed/blob/b3aac58db01c6bdc63452066bd9cd5f761e79044/stdlib/3/asyncio/__init__.pyi#L101

--
nosy: +gvanrossum, levkivskyi, xtreak

___
Python tracker 

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



[issue35987] Mypy and Asyncio import cannot be skipped

2019-02-13 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

This is not a Python issue, this should be reported on typeshed tracker (but 
likely a duplicate of the issue mentioned by Karthikeyan).

--
resolution:  -> third party
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



[issue35981] shutil make_archive create wrong file when base name contains dots at end

2019-02-13 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

On windows os.path.abspath("foo...bar..") returns "foo...bar" which is used in 
shutil.make_archive [0] returning foo...bar.zip. @matrixise , I am reopening 
this and adding Windows so that this can be confirmed as known behavior and 
closed.

https://github.com/python/cpython/blob/dcb68f47f74b0cc8a1896d4a4c5a6b83c0bbeeae/Lib/shutil.py#L964

--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
resolution: rejected -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue35988] Python interpreter segfault

2019-02-13 Thread Hinko Kocevar


New submission from Hinko Kocevar :

I'm running a tornado server with websockets client. Every now and then the 
python3.5 crashes, seg faults. I added code tracking 
(https://stackoverflow.com/questions/2663841/python-tracing-a-segmentation-fault)
 and this is what I see:

line, /usr/lib64/python3.5/asyncio/events.py:675
call, /usr/lib64/python3.5/asyncio/events.py:621
line, /usr/lib64/python3.5/asyncio/events.py:627
line, /usr/lib64/python3.5/asyncio/events.py:628
line, /usr/lib64/python3.5/asyncio/events.py:629
return, /usr/lib64/python3.5/asyncio/events.py:629
line, /usr/lib64/python3.5/asyncio/events.py:676
line, /usr/lib64/python3.5/asyncio/events.py:677
return, /usr/lib64/python3.5/asyncio/events.py:677
line, /usr/lib64/python3.5/asyncio/futures.py:172
line, /usr/lib64/python3.5/asyncio/futures.py:173
call, /usr/lib64/python3.5/asyncio/base_events.py:1461
line, /usr/lib64/python3.5/asyncio/base_events.py:1462
return, /usr/lib64/python3.5/asyncio/base_events.py:1462
return, /usr/lib64/python3.5/asyncio/futures.py:173
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:584
call, /usr/lib64/python3.5/asyncio/futures.py:315
line, /usr/lib64/python3.5/asyncio/futures.py:322
line, /usr/lib64/python3.5/asyncio/futures.py:325
return, /usr/lib64/python3.5/asyncio/futures.py:325
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:585
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:586
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:587
call, /usr/lib64/python3.5/site-packages/tornado/iostream.py:1045
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:1046
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:1047
call, /usr/lib64/python3.5/site-packages/tornado/iostream.py:134
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:135
return, /usr/lib64/python3.5/site-packages/tornado/iostream.py:135
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:1048
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:1050
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:1051
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:1052
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:1060
call, /usr/lib64/python3.5/site-packages/tornado/iostream.py:163
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:168
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:169
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:170
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:174
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:175
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:176
return, /usr/lib64/python3.5/site-packages/tornado/iostream.py:176
call, /usr/lib64/python3.5/site-packages/tornado/iostream.py:1247
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:1248
line, /usr/lib64/python3.5/site-packages/tornado/iostream.py:1249

Program received signal SIGPIPE, Broken pipe.
0x776f7bfb in __libc_send (fd=14, buf=0x118a0b0, n=2332, flags=0) at 
../sysdeps/unix/sysv/linux/x86_64/send.c:31
31ssize_t result = INLINE_SYSCALL (sendto, 6, fd, buf, n, flags, NULL,
Missing separate debuginfos, use: debuginfo-install 
python35u-3.5.6-1.ius.centos7.x86_64
(gdb) 
(gdb) 
(gdb) 
(gdb) bt
#0  0x776f7bfb in __libc_send (fd=14, buf=0x118a0b0, n=2332, flags=0) 
at ../sysdeps/unix/sysv/linux/x86_64/send.c:31
#1  0x7fffed7c6c66 in sock_send_impl () from 
/usr/lib64/python3.5/lib-dynload/_socket.cpython-35m-x86_64-linux-gnu.so
#2  0x7fffed7c9e06 in sock_call_ex () from 
/usr/lib64/python3.5/lib-dynload/_socket.cpython-35m-x86_64-linux-gnu.so
#3  0x7fffed7ca79f in sock_send () from 
/usr/lib64/python3.5/lib-dynload/_socket.cpython-35m-x86_64-linux-gnu.so
#4  0x779b60d9 in PyCFunction_Call () from /lib64/libpython3.5m.so.1.0
#5  0x77a2f646 in PyEval_EvalFrameEx () from /lib64/libpython3.5m.so.1.0
#6  0x77a2ea88 in PyEval_EvalFrameEx () from /lib64/libpython3.5m.so.1.0
#7  0x77a2ea88 in PyEval_EvalFrameEx () from /lib64/libpython3.5m.so.1.0
#8  0x77a30ebc in _PyEval_EvalCodeWithName () from 
/lib64/libpython3.5m.so.1.0
#9  0x77a2e22f in PyEval_EvalFrameEx () from /lib64/libpython3.5m.so.1.0
#10 0x77a30ebc in _PyEval_EvalCodeWithName () from 
/lib64/libpython3.5m.so.1.0
#11 0x77a2e22f in PyEval_EvalFrameEx () from /lib64/libpython3.5m.so.1.0
#12 0x77a30ebc in _PyEval_EvalCodeWithName () from 
/lib64/libpython3.5m.so.1.0
#13 0x77a2e22f in PyEval_EvalFrameEx () from /lib64/libpython3.5m.so.1.0
#14 0x77a30ebc in _PyEval_EvalCodeWithName () from 
/lib64/libpython3.5m.so.1.0
#15 0x77a2e22f in PyEval_EvalFrameEx () from /lib64/libpython3.5m.so.1.0
#16 0x779924c0 in gen_send_ex () from /lib64/libpython3.5m.so.1.0
#17 0x77a2ec28 in PyEval_EvalFrameEx () from /lib64/libpython3.5m.so.1.0
#18 0x77a30ebc in _PyEval_EvalCod

[issue33376] [pysqlite] Duplicate rows can be returned after rolling back a transaction

2019-02-13 Thread Cheryl Sabella


Change by Cheryl Sabella :


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



[issue35982] Create unit-tests for os.renames()

2019-02-13 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

Assigning this to me. FWIW I created a post on python-dev in order to add a 
test.support.rmpath() utility function and hopefully cover other os.* functions 
which may also be untested or not properly tested:
https://mail.python.org/pipermail/python-dev/2019-February/156267.html

--
assignee:  -> giampaolo.rodola

___
Python tracker 

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



[issue35988] Python interpreter segfault

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

> Program received signal SIGPIPE, Broken pipe.

SIGPIPE is not a bug, it's a deliberate signal to notice something to your 
application. You have to ignore SIGPIPE in gdb:

(gdb) handle SIGPIPE nostop noprint
SignalStop  Print   Pass to program Description
SIGPIPE   NoNo  Yes Broken pipe

--

___
Python tracker 

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



[issue35988] Python interpreter segfault

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

You can enable faulthandler to get a traceback of your Python theads when a 
crash occurs:
https://pythondev.readthedocs.io/debug_tools.html#get-a-traceback-on-a-crash

--

___
Python tracker 

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



[issue35988] Python interpreter segfault

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

> Every now and then the python3.5 crashes, seg faults.

Sorry but Python 3.5 no longer accepts bugfixes and has known bugs.
http://devguide.python.org/#status-of-python-branches

It's time to upgrade your Python!

Are you able to reproduce the crash on Python 3.6 or 3.7?

--
nosy: +vstinner

___
Python tracker 

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



[issue35224] PEP 572: Assignment Expressions

2019-02-13 Thread Emily Morehouse


Emily Morehouse  added the comment:

I have a work-in-progress (WIP) documentation branch I've been working on that 
I'll push up this week to address the following:

- Add summary to What's New in Doc/whatsnew/3.8.rst
- Add to list of delimiters in Doc/reference/lexical_analysis.rst
- Add usage documentation in Doc/reference/expressions.rst
- Update FAQ in Doc/faq/design.rst (https://bugs.python.org/issue35666)

If anyone has another area they think the documentation should be updated, 
please let me know!

--

___
Python tracker 

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



[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

2019-02-13 Thread Eric Snow


Eric Snow  added the comment:

FWIW, subclassing builtin types is a relatively new thing.  There are still a 
number of lingering (older) implementation details throughout CPython that were 
written assuming no subclassing.  I'd guess that this is one of them.

--
nosy: +eric.snow
stage:  -> test needed
type:  -> behavior

___
Python tracker 

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



[issue35988] Python interpreter segfault

2019-02-13 Thread Hinko Kocevar


Hinko Kocevar  added the comment:

> Are you able to reproduce the crash on Python 3.6 or 3.7?

I'm running it under python3.6 as we speak.

--

___
Python tracker 

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



[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

2019-02-13 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

By "relatively new thing", you mean less than 20 years old? :-)

--

___
Python tracker 

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



[issue35988] Python interpreter segfault

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

> [26194250.314042] Out of memory: Kill process 8399 (python3.6) score 574 or 
> sacrifice child

That's not a bug in Python: your application is using more memory than what is 
available in the system.

--

___
Python tracker 

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



[issue35224] PEP 572: Assignment Expressions

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

> If anyone has another area they think the documentation should be updated, 
> please let me know!

If we forget something, it's not an issue: it can be added later!

--

___
Python tracker 

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



[issue35988] Python interpreter segfault

2019-02-13 Thread Hinko Kocevar


Hinko Kocevar  added the comment:

Using python3.6 now.
I've also used the 'handle SIGPIPE nostop noprint' to skip SIGPIPE.

Now the interpreter is killed instead:

INF  2019-02-13 15:42:19,131 web:2162 log_request - 200 GET /NPM.html 
(10.0.6.209) 1.10ms

[Thread 0x7fffe76eb700 (LWP 8411) exited]
[Thread 0x7fffe78ec700 (LWP 8410) exited]
[Thread 0x7fffe7a2d700 (LWP 8409) exited]
[Thread 0x7fffe7d41700 (LWP 8408) exited]
[Thread 0x7fffe8542700 (LWP 8407) exited]

Program terminated with signal SIGKILL, Killed.
The program no longer exists.
(gdb) bt
No stack.
(gdb) 


And the dmesg shows, what I think is the real reason, for python3.5/3.6 dying 
on me (out of memory):

[26194250.313676] vmtoolsd invoked oom-killer: gfp_mask=0x201da, order=0, 
oom_score_adj=0
[26194250.313691] vmtoolsd cpuset=/ mems_allowed=0
[26194250.313696] CPU: 0 PID: 29876 Comm: vmtoolsd Not tainted 
3.10.0-693.21.1.el7.x86_64 #1
[26194250.313697] Hardware name: VMware, Inc. VMware Virtual Platform/440BX 
Desktop Reference Platform, BIOS 6.00 04/05/2016
[26194250.313698] Call Trace:
[26194250.313714]  [] dump_stack+0x19/0x1b
[26194250.313717]  [] dump_header+0x90/0x229
[26194250.313725]  [] ? ktime_get_ts64+0x52/0xf0
[26194250.313733]  [] ? delayacct_end+0x8f/0xb0
[26194250.313737]  [] oom_kill_process+0x254/0x3d0
[26194250.313739]  [] ? oom_unkillable_task+0xcd/0x120
[26194250.313740]  [] ? find_lock_task_mm+0x56/0xc0
[26194250.313742]  [] out_of_memory+0x4b6/0x4f0
[26194250.313744]  [] __alloc_pages_slowpath+0x5d6/0x724
[26194250.313747]  [] __alloc_pages_nodemask+0x405/0x420
[26194250.313752]  [] alloc_pages_current+0x98/0x110
[26194250.313757]  [] __page_cache_alloc+0x97/0xb0
[26194250.313759]  [] filemap_fault+0x170/0x420
[26194250.313869]  [] ext4_filemap_fault+0x36/0x50 [ext4]
[26194250.313875]  [] __do_fault+0x58/0xe0
[26194250.313876]  [] do_read_fault.isra.44+0x4b/0x130
[26194250.313880]  [] handle_mm_fault+0x691/0xfa0
[26194250.313888]  [] ? cputime_adjust+0x94/0x150
[26194250.313893]  [] __do_page_fault+0x154/0x450
[26194250.313894]  [] do_page_fault+0x35/0x90
[26194250.313898]  [] page_fault+0x28/0x30
[26194250.313912] Mem-Info:
[26194250.313915] active_anon:317608 inactive_anon:106541 isolated_anon:0
 active_file:836 inactive_file:1338 isolated_file:0
 unevictable:0 dirty:0 writeback:0 unstable:0
 slab_reclaimable:5892 slab_unreclaimable:7233
 mapped:394 shmem:334 pagetables:5322 bounce:0
 free:12861 free_pcp:12 free_cma:0
[26194250.313920] Node 0 DMA free:7624kB min:380kB low:472kB high:568kB 
active_anon:3680kB inactive_anon:3828kB active_file:4kB inactive_file:96kB 
unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15992kB 
managed:15908kB mlocked:0kB dirty:0kB writeback:0kB mapped:4kB shmem:4kB 
slab_reclaimable:96kB slab_unreclaimable:52kB kernel_stack:32kB 
pagetables:160kB unstable:0kB bounce:0kB free_pcp:0kB local_pcp:0kB 
free_cma:0kB writeback_tmp:0kB pages_scanned:492 all_unreclaimable? yes
[26194250.313925] lowmem_reserve[]: 0 1822 1822 1822
[26194250.313927] Node 0 DMA32 free:43820kB min:44672kB low:55840kB 
high:67008kB active_anon:1266752kB inactive_anon:422336kB active_file:3340kB 
inactive_file:5256kB unevictable:0kB isolated(anon):0kB isolated(file):0kB 
present:2080704kB managed:1867756kB mlocked:0kB dirty:0kB writeback:0kB 
mapped:1572kB shmem:1332kB slab_reclaimable:23472kB slab_unreclaimable:28880kB 
kernel_stack:3200kB pagetables:21128kB unstable:0kB bounce:0kB free_pcp:48kB 
local_pcp:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:11345 
all_unreclaimable? yes
[26194250.313930] lowmem_reserve[]: 0 0 0 0
[26194250.313932] Node 0 DMA: 4*4kB (UEM) 9*8kB (UEM) 9*16kB (UEM) 3*32kB (E) 
2*64kB (UE) 2*128kB (UE) 3*256kB (UM) 4*512kB (UEM) 4*1024kB (EM) 0*2048kB 
0*4096kB = 7624kB
[26194250.313939] Node 0 DMA32: 386*4kB (E) 482*8kB (UE) 324*16kB (UEM) 
247*32kB (UEM) 157*64kB (UEM) 56*128kB (UEM) 18*256kB (UEM) 7*512kB (UEM) 
0*1024kB 0*2048kB 0*4096kB = 43896kB
[26194250.313945] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 
hugepages_size=2048kB
[26194250.313946] 3429 total pagecache pages
[26194250.313947] 890 pages in swap cache
[26194250.313950] Swap cache stats: add 52552391, delete 52551501, find 
24707502/29312733
[26194250.313951] Free swap  = 0kB
[26194250.313951] Total swap = 2047996kB
[26194250.313952] 524174 pages RAM
[26194250.313953] 0 pages HighMem/MovableOnly
[26194250.313953] 53258 pages reserved
[26194250.313954] [ pid ]   uid  tgid total_vm  rss nr_ptes swapents 
oom_score_adj name
[26194250.313963] [  564] 0   564 9307  371  23   46
 0 systemd-journal
[26194250.313965] [  751]81   751 9244  104  21   89
  -900 dbus-daemon
[26194250.313967] [  783] 0   783   138064   94 101 9333
 0 NetworkManager
[26194250.313968] [  849] 0   849283430  58 3123
 0 dhclient
[26194250.313970] [ 1016] 0  1016 8818   35  19  236  

[issue35972] _xxsubinterpreters: channel_send() may truncate ints on 32-bit platforms

2019-02-13 Thread Eric Snow


Eric Snow  added the comment:

ack

--

___
Python tracker 

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



[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

2019-02-13 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


--
keywords: +patch
pull_requests: +11871
stage: test needed -> patch review

___
Python tracker 

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



[issue35989] ipaddress.IPv4Network allows prefix > 32

2019-02-13 Thread John Florian


New submission from John Florian :

I wanted a simple is_valid_ipv4_network() function, so I wrote one and a bunch 
of unit tests where I discovered that I can legally:

>>> n = IPv4Network(('192.168.123.234', 12345678))
>>> n
IPv4Network('192.168.123.234/12345678')
>>> n.prefixlen
12345678
>>> n.max_prefixlen
32

I assume this is a bug.

--
messages: 335460
nosy: John Florian
priority: normal
severity: normal
status: open
title: ipaddress.IPv4Network allows prefix > 32
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



[issue35989] ipaddress.IPv4Network allows prefix > 32

2019-02-13 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue35984] test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=1

2019-02-13 Thread Eric Snow


Eric Snow  added the comment:

Alexey, even though the refleak does not appear to be related to your earlier 
PR, you are welcome to keep working on this issue. :)  If you do then please 
add me as a reviewer on whatever PR you make.  Also, I'd be glad to answer any 
questions you have about the _xxsubinterpreters module.  The more folks that 
understand that code, the better. :)

On the other hand, if you decide at this point that you'd rather do something 
else than track down refleaks I introduced then I'd totally understand. :)  In 
that case feel free to assign this issue to me at that time.

--
stage:  -> test needed
type:  -> resource usage

___
Python tracker 

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



[issue35984] test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=1

2019-02-13 Thread Eric Snow


Eric Snow  added the comment:

FYI, the _xxsubinterpreters module serves several purposes.  First, it allows 
us to more thoroughly test the subinterpreter functionality of CPython (doing 
so via _testembed and _testcapi is messy), effectively in 
test__xxsubinterpreters.  Second, it is the foundation for helpers (which I 
intend on adding to test.support in the 3.8 time frame) for easily using 
subinterpreters in the test suite in lieu of subprocesses.  Third, ultimately 
it will be the low-level implementation of PEP 554.

--

___
Python tracker 

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



[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

2019-02-13 Thread Eric Snow


Eric Snow  added the comment:

On Wed, Feb 13, 2019 at 8:42 AM Antoine Pitrou  wrote:
> Antoine Pitrou  added the comment:
>
> By "relatively new thing", you mean less than 20 years old? :-)

Yeah, looks like it was in the 2.2 release (Dec 2001) for PEP 253.
Anyway, I know of several core devs who are still opposed to
subclassing builtin types. :)

--

___
Python tracker 

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



[issue35886] Move PyInterpreterState into Include/internal/pycore_pystate.h

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

> @Victor, do you see any problems with doing this?  It will help simplify 
> other changes I'm working on.

I'm quite sure that they are users of the PyInterpreterState structure outside 
CPython internals and stdlib, but I expect that the number is quite low.

Since internal headers are now installed (I modified "make install" for that) 
(but need to define Py_BUILD_CORE), it might be acceptable to force users of 
this structure to opt-in for internal headers.

Just make sure that we properly communicate on such backward incompatible 
changes:

* "C API Changes" section of 
https://docs.python.org/dev/whatsnew/3.8.html#porting-to-python-3-8
* mail to python-dev

The bpo-35810 also proposes a subtle backward incompatible change which makes 
me unhappy, but Stefan Behnel seems less scared than me, so maybe it will be 
fine.

Maybe we need to organize a collective effort to better communicate on our 
backward incompatible C API changes. The capi-sig mailing list may be a good 
channel for that. I asked to test some popular C extensions to check that they 
are not broken. If it's the case, we should help them to be prepared for the 
new C API.

--

___
Python tracker 

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



[issue35989] ipaddress.IPv4Network allows prefix > 32

2019-02-13 Thread SilentGhost


Change by SilentGhost :


--
components: +Library (Lib)
nosy: +pitrou
stage:  -> test needed
type:  -> behavior

___
Python tracker 

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



[issue35949] Move PyThreadState into Include/internal/pycore_pystate.h

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

Same ratione than for PyInterpreterState: 
https://bugs.python.org/issue35886#msg335464

Except that I expect that a few more projects rely on PyThreadState fields. 
Maybe not. It's hard to guess :-(

I mean that I'm ok-ish with the change but it should be carefully prepared and 
announced.

--

___
Python tracker 

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



[issue35907] Unnecessary URL scheme exists to allow file:// reading file in urllib

2019-02-13 Thread Sihoon Lee


Change by Sihoon Lee :


--
keywords: +patch
pull_requests: +11872
stage: needs patch -> patch review

___
Python tracker 

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



[issue35706] Make it easier to use a venv with an embedded Python interpreter

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-22213.

--

___
Python tracker 

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



[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

PEP 432 will allow to give with fine control on parameters used to initialize 
Python. Sadly, I failed to agree with Nick Coghlan and Eric Snow on the API. 
The current implementation (_PyCoreConfig and _PyMainInterpreterConfig) has 
some flaw (don't separate clearly the early initialization and Unicode-ready 
state, the interpreter contains main and core config whereas some options are 
duplicated in both configs, etc.).

See also bpo-35706.

--

___
Python tracker 

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



[issue35706] Make it easier to use a venv with an embedded Python interpreter

2019-02-13 Thread STINNER Victor


STINNER Victor  added the comment:

PEP 432 will allow to give with fine control on parameters used to initialize 
Python. Sadly, I failed to agree with Nick Coghlan and Eric Snow on the API. 
The current implementation (_PyCoreConfig and _PyMainInterpreterConfig) has 
some flaw (don't separate clearly the early initialization and Unicode-ready 
state, the interpreter contains main and core config whereas some options are 
duplicated in both configs, etc.).

--

___
Python tracker 

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



[issue35706] Make it easier to use a venv with an embedded Python interpreter

2019-02-13 Thread Steve Dower


Steve Dower  added the comment:

That's not a "see also" - it's just a duplicate :) I'll close this one as the 
other one has been around longer.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Make pyvenv style virtual environments easier to configure when 
embedding Python

___
Python tracker 

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



[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-13 Thread Steve Dower


Steve Dower  added the comment:

I just closed 35706 as a duplicate of this one (the titles are basically 
identical, which feels like a good hint ;) )

It seems that the disagreement about the design is fundamentally a disagreement 
between a "quick, painful but complete fix" and "slow, careful improvements 
with a transition period". Both are valid approaches, and since Victor is 
putting actual effort in right now he gets to "win", but I do think we can 
afford to move faster.

It seems the main people who will suffer from the pain here are embedders (who 
are already suffering pain) and the core developers (who explicitly signed up 
for pain!). But without knowing the end goal, we can't accelerate.

Currently PEP 432 is the best description we have, and it looks like Victor has 
been heading in that direction too (deliberately? I don't know :) ). But it 
seems like a good time to review it, replace the "here's the current state of 
things" with "here's an imaginary ideal state of things" and fill the rest with 
"here are the steps to get there without breaking the world".

By necessity, it touches a lot of people's contributions to Python, but it also 
has the potential to seriously improve even more people's ability to _use_ 
Python (for example, I know an app that you all would recognize the name of who 
is working on embedding Python right now and would _love_ certain parts of this 
side of things to be improved).

Nick - has the steering council been thinking about ways to promote 
collaborative development of ideas like this? I'm thinking an Etherpad style 
environment for the brainstorm period (in lieu of an in-person whiteboard 
session) that's easy for us all to add our concerns to, that can then be turned 
into something more formal.

Nick, Victor, Eric, (others?) - are you interested in having a virtual 
whiteboard session to brainstorm how the "perfect" initialization looks? And 
probably a follow-up to brainstorm how to get there without breaking the world? 
I don't think we're going to get to be in the same room anytime before the 
language summit, and it would be awesome to have something concrete to discuss 
there.

--

___
Python tracker 

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



[issue35988] Python interpreter segfault

2019-02-13 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

"your application is using more memory than what is available in the system." 

Well, it alone may not be using more memory, but the cumulative usage on the 
system is "too high" by whatever metric the OOM killer is using (IIRC the 
default rule is that actual committed memory must be less than swap size + 50% 
of RAM). The OOM killer is a strange and terrible beast, and the behavior 
varies based on configuration, relative memory usage of each process grouping, 
minimizing number of processes killed, etc.

You can find deep implementation details on it (including how to disable a 
given process for consideration) here: https://linux-mm.org/OOM_Killer

The real solution to problems like this usually amounts to:

1. Install more RAM.

2. Increase the size of your swap partition. Doesn't "fix" being shy of memory 
if you're actually using more memory than you have RAM, but allows you to 
handle overcommit (particularly for fork+exec scenarios where the forked 
process's memory will be freed momentarily) without the OOM killer getting 
involved, and to limp along slowly, without actually failing, if you actually 
allocate and use more memory than you have RAM.

3. Tweak the overcommit heuristics to allow more overcommit before invoking the 
OOM killer.

4. Disable overcommit entirely, so memory allocations fail immediately if 
sufficient backing storage is not available, rather than succeeding, only to 
invoke the OOM killer when the allocated memory gets used and the shortage is 
discovered. This is a good solution if the program(s) in question aren't poorly 
designed such that they try to allocate many GBs of memory up front even when 
they're unlikely to need it; unfortunately, there are commonly used programs 
that overallocate like this and render this solution non-viable if they're part 
of your setup.

Regardless, this isn't a bug in Python itself. Any process that uses a lot of 
memory (Apache, MySQL) and hasn't explicitly removed itself from OOM killer 
consideration is going to look tasty when an OOM scenario occurs.

--
nosy: +josh.r
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



[issue5038] urrlib2/httplib doesn't reset file position between requests

2019-02-13 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
pull_requests: +11873
stage: test needed -> patch review

___
Python tracker 

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



[issue15753] No-argument super in method with variable arguments raises SystemError

2019-02-13 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Moving from pending back to open (not sure what was "pending" about it?).

The workaround is viable (and used by Python implemented dict subclasses in the 
standard library since they must accept **kwargs with arbitrary strings, 
including self), but it does seem a little silly that it's required. Leaving it 
as low priority since the workaround exists.

Still, would be nice to make super() seamless, pulling the first argument if 
the function accepts it as non-varargs, and the first element of the first 
argument if it's varargs. If someone reassigns self/args, that's on them; it's 
fine to raise a RuntimeError if they use no-arg super(), requiring them to use 
two-arg super explicitly in that case.

--
priority: normal -> low
status: pending -> open
versions: +Python 3.8 -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue15753] No-argument super in method with variable arguments raises SystemError

2019-02-13 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue35990] ipaddress.IPv4Interface won't accept 2-tuple (address, mask)

2019-02-13 Thread John Florian


New submission from John Florian :

The docs say """The meaning of address is as in the constructor of IPv4Network, 
except that arbitrary host addresses are always accepted."""

However, that doesn't seem to be entirely true:

>>> tup1 = ('192.168.123.234', 24)
>>> tup2 = ('192.168.123.234', '255.255.255.0')
>>> IPv4Network(tup1, strict=False)
IPv4Network('192.168.123.0/24')
>>> IPv4Network(tup2, strict=False)
IPv4Network('192.168.123.0/24')
>>> IPv4Interface(tup1)
IPv4Interface('192.168.123.234/24')
>>> IPv4Interface(tup2)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.7/ipaddress.py", line 1391, in __init__
self._prefixlen = int(address[1])
ValueError: invalid literal for int() with base 10: '255.255.255.0'

--
messages: 335474
nosy: John Florian
priority: normal
severity: normal
status: open
title: ipaddress.IPv4Interface won't accept 2-tuple (address, mask)
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



[issue35989] ipaddress.IPv4Network allows prefix > 32

2019-02-13 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
keywords: +patch
pull_requests: +11875
stage: test needed -> patch review

___
Python tracker 

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



[issue35989] ipaddress.IPv4Network allows prefix > 32

2019-02-13 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

I proposed my PR but I prefer a review because in the code of ipaddress, there 
is a function for the validation of an address with the netmask. Maybe we could 
use this function and try to refactor/improve the current code.

--
nosy: +matrixise

___
Python tracker 

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



[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

2019-02-13 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

NOTE: also OrderedDict currently uses trashcan hacking to work around this 
problem:

/* Call the base tp_dealloc().  Since it too uses the trashcan mechanism,
 * temporarily decrement trash_delete_nesting to prevent triggering it
 * and putting the partially deallocated object on the trashcan's
 * to-be-deleted-later list.
 */
--tstate->trash_delete_nesting;
assert(_tstate->trash_delete_nesting < PyTrash_UNWIND_LEVEL);
PyDict_Type.tp_dealloc((PyObject *)self);
++tstate->trash_delete_nesting;

So this seems to be a known problem which deserves to be fixed properly.

--

___
Python tracker 

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



[issue35984] test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=1

2019-02-13 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


--
keywords: +patch
pull_requests: +11876
stage: test needed -> patch review

___
Python tracker 

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



[issue35984] test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=1

2019-02-13 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

Thank you for your introduction about _xxsubinterpreters, Eric.

This particular leak is easy: it's right in _channel_send(). I've submitted a 
PR.

I've also done a quick scan of neighboring code, and it seems there are other 
leaks as well, e.g.:

* PyThread_free_lock() is not called at 
https://github.com/python/cpython/blob/dcb68f47f74b0cc8a1896d4a4c5a6b83c0bbeeae/Modules/_xxsubinterpretersmodule.c#L761
 (and below)

* data is not released and freed at 
https://github.com/python/cpython/blob/dcb68f47f74b0cc8a1896d4a4c5a6b83c0bbeeae/Modules/_xxsubinterpretersmodule.c#L1387

Do you think it'd make sense to go through the module to find and fix leaks? Or 
is this code in an early stage for such cleanup?

As a side note, such leaks should be easily found by static analyzers such as 
Coverity (assuming it understands CPython allocation functions like PyMem_NEW), 
so it might make sense to check out its reports on the module.

--

___
Python tracker 

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



[issue17703] Trashcan mechanism segfault during interpreter finalization in Python 2.7.4

2019-02-13 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

See also https://bugs.python.org/issue35983 for another trashcan-related issue.

--
nosy: +jdemeyer

___
Python tracker 

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



  1   2   >