[issue38731] bad input crashes py_compile library

2020-07-02 Thread Hubert Pineault


Hubert Pineault  added the comment:

The bug is still there in python 3.8.4rc1
It has nothing to do with the doc.

As pointed by Kaoru, it is introduced in line 200 of commit 
2e33ecd7c9b0cac3efc6fcbdd4547fd086b4e2d1

see this comment, also by Kaoru:
https://github.com/python/cpython/commit/2e33ecd7c9b0cac3efc6fcbdd4547fd086b4e2d1#r35842880

--
nosy: +hubide
versions:  -Python 3.9

___
Python tracker 

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



[issue896330] pyconfig.h is not placed in --includedir

2020-07-02 Thread Ned Deily


Change by Ned Deily :


--
nosy:  -Mario Gonzalez

___
Python tracker 

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



[issue896330] pyconfig.h is not placed in --includedir

2020-07-02 Thread Ned Deily


Change by Ned Deily :


--
Removed message: https://bugs.python.org/msg372730

___
Python tracker 

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



[issue33665] tkinter.ttk.Scrollbar.fraction() under-estimates length

2020-07-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for testing it E. Paine. I agree that it is not a Tkinter issue.

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



[issue41066] Update documentation for Pathlib

2020-07-02 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +pitrou

___
Python tracker 

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



[issue40213] contextlib.aclosing()

2020-07-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Do you have use cases or want to add it for pure "symmetry" reasons?

contextlib.closing() was added when context managers were new, and many classes 
that own resources did have the close() method but did not support the context 
manager protocol. Now most of these classes are context managers, and new 
classes usually are written with the support of  the context manager protocol 
from beginning. The usefulness of contextlib.closing() is much smaller now.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue41197] Async magic methods in contextlib.closing

2020-07-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Warning is not error. It may left unnoticed, especially if the code is executed 
on server. And in this particular case turning the warning into exception by 
setting warning filters does not help, because it would be raised in the 
context where exceptions are swallowed.

--

___
Python tracker 

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



[issue41197] Async magic methods in contextlib.closing

2020-07-02 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This seems to be a duplicate of issue40213 with a link to implementation in 
trio.

--
nosy: +xtreak

___
Python tracker 

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



[issue41196] APPDATA directory is different in store installed python

2020-07-02 Thread Eryk Sun


Eryk Sun  added the comment:

> What it really means for apps that are trying to share state across
> different Python runtimes is that they're not going to have such a 
> great time.

I tried impersonating the token of Explorer in the current thread (i.e. 
GetShellWindow, GetWindowThreadProcessId, OpenProcess, OpenProcessToken, 
ImpersonateLoggedOnUser), but writing to AppData was still redirected. 
Apparently redirection for apps only looks at the process token. A crude 
workaround is to script PowerShell or CMD in a child process.

--
nosy: +eryksun

___
Python tracker 

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



[issue41165] [Python 3.10] Remove APIs deprecated long enough

2020-07-02 Thread Inada Naoki


Inada Naoki  added the comment:

Hmm.  You are right. The warnings are shown by default.

On the other hand, some project uses custom `setup.py test` command. It hides 
the DeprecationWarning.

https://github.com/warner/python-ed25519/blob/master/setup.py
https://github.com/warner/python-ed25519/blob/master/src/ed25519/test_ed25519.py#L42

How about emitting FutureWarning instead of DeprecationWarning?

DeprecationWarning is hidden to avoid end users see noisy warnings.
But test is for developers, not end users.

--

___
Python tracker 

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



[issue41180] marshal load bypass code.__new__ audit event

2020-07-02 Thread Yunfan Zhan


Yunfan Zhan  added the comment:

Before this, we only audit code.__new__ and code.replace, as these methods 
allow constructing arbitrary code objects, and we don't audit code object 
coming from the normal way (like compile,exec,eval).
If the event is raised in PyCode_NewWithPosOnlyArgs, is it ok that the compiled 
code is also audited?

--

___
Python tracker 

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



[issue41199] Docstring convention not followed for dataclasses documentation page

2020-07-02 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +eric.smith

___
Python tracker 

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



[issue41199] Docstring convention not followed for dataclasses documentation page

2020-07-02 Thread Jackstraw


New submission from Jackstraw :

The InventoryItem class on the dataclasses page 
[https://docs.python.org/3.7/library/dataclasses.html#module-dataclasses] has 
single quotes for the docstring, as opposed to double quotes (as described by 
PEP-257.

--
assignee: docs@python
components: Documentation
messages: 372899
nosy: JackStraw, docs@python
priority: normal
severity: normal
status: open
title: Docstring convention not followed for dataclasses documentation page
type: enhancement
versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-02 Thread miss-islington


miss-islington  added the comment:


New changeset bfec674254ea22ef9c0c335587eb65683f4145c7 by Miss Islington (bot) 
in branch '3.9':
bpo-39960: Allow heap types in the "Carlo Verre" hack check that override 
"tp_setattro()" (GH-21092)
https://github.com/python/cpython/commit/bfec674254ea22ef9c0c335587eb65683f4145c7


--

___
Python tracker 

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



[issue41169] socket.inet_pton raised when pass an IPv6 address like "[::]" to it

2020-07-02 Thread Wator Sead


Wator Sead  added the comment:

The point is square brackets, not the address, they (socket.inet_pton and 
socket.socket) behave different. Can make it not be accepted, any conditions?

--
versions:  -Python 3.7, Python 3.8

___
Python tracker 

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



[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-02 Thread Guido van Rossum


Guido van Rossum  added the comment:

Stefan can you do the 3.8 backport?

--

___
Python tracker 

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



[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-02 Thread miss-islington


miss-islington  added the comment:


New changeset 148f32913573c29250dfb3f0d079eb8847633621 by scoder in branch 
'master':
bpo-39960: Allow heap types in the "Carlo Verre" hack check that override 
"tp_setattro()" (GH-21092)
https://github.com/python/cpython/commit/148f32913573c29250dfb3f0d079eb8847633621


--
nosy: +miss-islington

___
Python tracker 

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



[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20435
pull_request: https://github.com/python/cpython/pull/21288

___
Python tracker 

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



[issue41198] Round built-in function not shows zeros acording significant figures and calculates different numbers of odd and even

2020-07-02 Thread Tim Peters


Tim Peters  added the comment:

Cool! So the only thing surprising to me here is just how far off balance the 
arange() run was.  So I'd like to keep this open long enough for Mark to 
notice, just in case it's pointing to something fishy in numpy.

--

___
Python tracker 

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



[issue17805] No such class: multiprocessing.pool.AsyncResult

2020-07-02 Thread Volker Weißmann

Volker Weißmann  added the comment:

Tomorror, or in a few days, I'm gonna create a pullrequest for it.

--

___
Python tracker 

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



[issue41162] Clear audit hooks after destructors

2020-07-02 Thread Steve Dower


Steve Dower  added the comment:

PR 21222 (with test updates) is a good fix, though we know there can still be 
arbitrary code executed afterwards. But it's not in a place where we can 
reliably hook.

Probably the best thing to do is to make sure that events are raised for 
anything that would be required to add code there. Though that may not be 
feasible either, but since nobody should be doing that kind of thing 
deliberately, detection is just as valuable as prevention.

--

___
Python tracker 

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



[issue17805] No such class: multiprocessing.pool.AsyncResult

2020-07-02 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Volker Weißmann, this issue has been closed for 7 years, if you want to 
propose a change, please open a new issue.

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue41198] Round built-in function not shows zeros acording significant figures and calculates different numbers of odd and even

2020-07-02 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

If you change the starting point of the rounding away from zero, the bias flips 
back and forth, which is exactly what I would expect from Banker's Rounding:


def check_bias(start):
d = 0.001
ne = no = 0
for i in range(1000):
digit = int(round(start + i * d, 1) * 10)
if digit & 1:
no += 1
else:
ne += 1
return ne, no


# Python 3.7
>>> check_bias(0.0)
(501, 499)
>>> check_bias(0.1)
(500, 500)
>>> check_bias(0.2)
(499, 501)
>>> check_bias(0.3)
(499, 501)
>>> check_bias(0.4)
(500, 500)
>>> check_bias(0.5)
(499, 501)
>>> check_bias(0.6)
(501, 499)


I ran the same check_bias in Python 2.7, which doesn't use bankers rounding, 
and the bias is consistently in one direction:

# Python 2.7
>>> check_bias(0.0)
(500, 500)
>>> check_bias(0.1)
(499, 501)
>>> check_bias(0.2)
(498, 502)
>>> check_bias(0.3)
(498, 502)
>>> check_bias(0.4)
(499, 501)
>>> check_bias(0.5)
(498, 502)
>>> check_bias(0.6)
(500, 500)

--

___
Python tracker 

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



[issue17805] No such class: multiprocessing.pool.AsyncResult

2020-07-02 Thread Volker Weißmann

Volker Weißmann  added the comment:

The documentation here: 
https://docs.python.org/3/library/multiprocessing.html#module-multiprocessing.pool
says that apply_async is "A variant of the apply() method which returns a 
result object."
You should replace "a result object" with "a AsyncResult/ApplyResult object" 
and a link to 
https://docs.python.org/2/library/multiprocessing.html#multiprocessing.pool.AsyncResult

--
nosy: +Volker Weißmann
versions: +Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9 -Python 2.7, 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



[issue41198] Round built-in function not shows zeros acording significant figures and calculates different numbers of odd and even

2020-07-02 Thread Tim Peters


Tim Peters  added the comment:

I assumed Mark would tell us what's up with the arange() oddity, so let's see 
whether he does.  There is no truly good way to generate "evenly spaced" binary 
floats using a non-representable conceptual decimal delta.  The dumbass ;-) way 
doesn't show a discrepancy in pure Python:

>>> num = ne = no = 0
>>> d = 0.001
>>> while num < 1.0:
... digit = int(round(num, 1) * 10)
... if digit & 1:
... no += 1
... else:
... ne += 1
... num += d
>>> ne, no
(500, 500)

However, a somewhat less naive way does show a discrepancy, but less so than 
what arange() apparently does:

>>> ne = no = 0
>>> for i in range(1000):
... digit = int(round(i * d, 1) * 10)
... if digit & 1:
... no += 1
... else:
... ne += 1
>>> ne, no
(501, 499)

I assume that's because of the specific nearest/even behavior I already showed 
for multipliers i=250 and i=750.

--

___
Python tracker 

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



[issue41198] Round built-in function not shows zeros acording significant figures and calculates different numbers of odd and even

2020-07-02 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Thank you for your long and detailed bug report, but please post one issue per 
bug report.

Tim, we agree that the notion of significant figures is irrelevant; is Carlos' 
even/odd test sufficiently flawed that we should close this bug report, or keep 
it open to investigate the rounding bias issue? My feeling is that it is 
sufficiently flawed that we can just close this, but it's too early in the 
morning for me to articulate why :-)

--
nosy: +steven.daprano

___
Python tracker 

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



[issue41198] Round built-in function not shows zeros acording significant figures and calculates different numbers of odd and even

2020-07-02 Thread Carlos Neves

Carlos Neves  added the comment:

Hi Peters,

I will pay more attention to the Python docs :)
Thank you for your direction.

Carlos A. Neves

Em qui., 2 de jul. de 2020 às 18:22, Tim Peters
 escreveu:
>
>
> Tim Peters  added the comment:
>
> For the first, your hardware's binary floating-point has no concept of 
> significant trailing zeroes. If you need such a thing, use Python's `decimal` 
> module instead, which does support a "significant trailing zero" concept. You 
> would need an entirely new data type to graft such a notion onto Python's (or 
> numpy's!) binary floats.
>
> For the second, we'd have to dig into exactly what numpy's `arange()` does. 
> Very few of the numbers you're working with are exactly representable in 
> binary floating point except for 0.0. For example, "0.001" is approximated by 
> a binary float whose exact decimal value is
>
> 0.00120816681711721685132943093776702880859375
>
> Sometimes the rounded (by machine float arithmetic) multiples of that are 
> exactly representable, but usually not. For example,
>
> >>> 0.001 * 250
> 0.25
>
> rounds to the exactly representable 1/4, and
>
> >>> 0.001 * 750
> 0.75
>
> to the exactly representable 3/4. However, `round()` uses 
> round-to-nearest/even, and then
>
> >>> round(0.25, 1)
> 0.2
> >>> round(0.75, 1)
> 0.8
>
> both resolve the tie to the closest even value (although neither of those 
> _results_ are exactly representable in binary floating-point - although if 
> you go on to multiply them by 10.0, they do round (in hardware) to exactly 
> 2.0 and 8.0).
>
> Note that numpy's arange() docs do warn you against using it ;-)
>
> """
> When using a non-integer step, such as 0.1, the results will often not be 
> consistent. It is better to use numpy.linspace for these cases.
> """
>
> --
> nosy: +tim.peters
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue35105] Document that CPython accepts "invalid" identifiers

2020-07-02 Thread Roy Smith


Roy Smith  added the comment:

Just as another edge case, type() can do the same thing:

Foo = type("Foo", (object,), {"a b": 1})
f = Foo()

for example, will create a class attribute named "a b".  Maybe this actually 
calls setattr() under the covers, but if it's going to be documented, it should 
be noted in both places.

--
nosy: +roysmith

___
Python tracker 

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



[issue41198] Round built-in function not shows zeros acording significant figures and calculates different numbers of odd and even

2020-07-02 Thread Tim Peters


Tim Peters  added the comment:

For the first, your hardware's binary floating-point has no concept of 
significant trailing zeroes. If you need such a thing, use Python's `decimal` 
module instead, which does support a "significant trailing zero" concept. You 
would need an entirely new data type to graft such a notion onto Python's (or 
numpy's!) binary floats.

For the second, we'd have to dig into exactly what numpy's `arange()` does. 
Very few of the numbers you're working with are exactly representable in binary 
floating point except for 0.0. For example, "0.001" is approximated by a binary 
float whose exact decimal value is

0.00120816681711721685132943093776702880859375

Sometimes the rounded (by machine float arithmetic) multiples of that are 
exactly representable, but usually not. For example,

>>> 0.001 * 250
0.25

rounds to the exactly representable 1/4, and

>>> 0.001 * 750
0.75

to the exactly representable 3/4. However, `round()` uses 
round-to-nearest/even, and then

>>> round(0.25, 1)
0.2
>>> round(0.75, 1)
0.8

both resolve the tie to the closest even value (although neither of those 
_results_ are exactly representable in binary floating-point - although if you 
go on to multiply them by 10.0, they do round (in hardware) to exactly 2.0 and 
8.0).

Note that numpy's arange() docs do warn you against using it ;-)

"""
When using a non-integer step, such as 0.1, the results will often not be 
consistent. It is better to use numpy.linspace for these cases.
"""

--
nosy: +tim.peters

___
Python tracker 

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



[issue41177] ConvertingList and ConvertingTuple lack iterators and ConvertingDict lacks items()

2020-07-02 Thread Michael DePalatis


Michael DePalatis  added the comment:

I think the other issue here is that the ConvertingX classes aren't documented 
apart from comments in the code where they are defined.

--
nosy: +mivade

___
Python tracker 

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



[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-02 Thread Stefan Behnel


Stefan Behnel  added the comment:

I think we missed the train for fixing 3.7 (which was questionable anyway), but 
I added a test, so it's ready for merging into 3.8+ (minus merge conflicts for 
the test in 3.8, probably).

--

___
Python tracker 

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



[issue41196] APPDATA directory is different in store installed python

2020-07-02 Thread Steve Dower


Steve Dower  added the comment:

As an aside, virtual environments will have the same redirection as the base 
interpreter, so this is really only an issue between a 3.7 install and a 3.8 
install, or a Store install and a traditional install.

--

___
Python tracker 

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



[issue41196] APPDATA directory is different in store installed python

2020-07-02 Thread Steve Dower


Steve Dower  added the comment:

This is by (Windows's) design - separate apps are treated as separate by the 
Windows app model. In the latest and N-1 updates to Windows, the AppData 
redirection only applies to newly created files, not those that already exist. 
[1] Before then, it used copy-on-write.

The design is based on having seen many apps break because of inadvertently 
sharing data, and also apps failing to clean up after themselves well (of which 
Python is *very* guilty). The built-in "Reset App" and "Uninstall App" 
functions would not be viable without this separation.

What it really means for apps that are trying to share state across different 
Python runtimes is that they're not going to have such a great time. The best 
option I can offer is to use the user's Documents folder instead, which is 
explicitly shared (though may also be synced between machines, so not always 
appropriate).

The next best option is to recommend that the Store package only be used on its 
own, and not in conjunction with other Python installs. Those who need multiple 
versions or mostly-but-not-quite-separate installs will need to use the 
traditional installer.

But what it means for all the other tools that write to AppData is that they 
don't have to worry about old settings laying around or causing additional 
clutter. The standard "Reset app" action is a viable way to fix issues in 
configuration or cached files (and uninstall all packages). From a user point 
of view, I really like these features.

1: 
https://docs.microsoft.com/windows/msix/desktop/desktop-to-uwp-behind-the-scenes

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



[issue38980] Compile libpython with -fno-semantic-interposition

2020-07-02 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Yes this should become part of --with-optimizations when building on a platform 
using a compiler that (a) supports it and (b) where it matters.

If this is only relevant on --enable-shared builds (not the default), i'd 
assume also make it conditional on that.

I never use --enable-shared builds myself.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue41198] Round built-in function not shows zeros acording significant figures and calculates different numbers of odd and even

2020-07-02 Thread Carlos Neves


New submission from Carlos Neves :

Hi,

I am observing unexpected behavior with round built-in function about (1) 
significant figures in analytical methods and (2) number of odd and even 
numbers obtained by this function.

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

https://en.wikipedia.org/wiki/Significant_figures

1. Significant Figures
==

For example, when I say 1.20 in analytical methods, I am confident about the 
last digit, the zero. It has a meaning. But, when I use Python,

>>> round (1.203, 2)
1.2
>>>

the zero not appears. It is not occur when the second digit is not zero. 

>>> round (1.213, 2)
1.21
>>>

The zero should be printed like the other numbers to be consistent with the 
significant figures. Maybe other functions could present the same behavior.

2. Rounding procedure
=

I wrote the following code to test the number of odd and even numbers during a 
round procedure. I should get half-and-a-half of odd and even numbers. But the 
result using the round function is different. We observed 5 even more and 5 odd 
less. This behavior causes a systematic error.

https://en.wikipedia.org/wiki/Rounding

I hope to be contributing to the improvement of the code.

Thank advanced.


##
# This code count the number of odd and even number with different procedures: 
truncate, round simple and round function 
# Test condition: Rounding with one digit after the decimal point.

import numpy as np

even_0 = 0
odd_0 = 0

even_1 = 0
odd_1 = 0

even_2 = 0
odd_2 = 0

even_3 = 0
odd_3 = 0

# generate 1000 numbers from 0.000 up to 1 with step of 0.001
x = np.arange(0,1,0.001) 

# printing 
for i in range(len(x)): 

x_truncated = int((x[i]*10)+0.0)/10 # no rounding
x_rounded_simple = int((x[i]*10)+0.5)/10 # rounding up at 5
x_rounded_function = round(x[i],1) # rounding by function with one 
digit after the decimal point

# counting odd and even numbers
if int(x[i]*1000) % 2 == 0:
even_0 += 1
else:
odd_0 += 1

if int(x_truncated*10) % 2 == 0:
even_1 += 1
else:
odd_1 += 1

if int(x_rounded_simple*10) % 2 == 0:
even_2 += 1
else:
odd_2 += 1

if int(x_rounded_function*10) % 2 == 0:
even_3 += 1
else:
odd_3 += 1

print ("{0:.3f} {1:.1f} {2:.1f} {3:.1f}".format((x[i]), x_truncated, 
x_rounded_simple, x_rounded_function))

print ("Result:")
print ("Raw: Even={0}, Odd={1}".format(even_0,odd_0))   
print ("Truncated: Even={0}, Odd={1}".format(even_1,odd_1))
print ("Rounded simple: Even={0}, Odd={1}".format(even_2,odd_2))
print ("Rounded Function: Even={0}, Odd={1}".format(even_3,odd_3))

##

Output
...
0.995 0.9 1.0 1.0
0.996 0.9 1.0 1.0
0.997 0.9 1.0 1.0
0.998 0.9 1.0 1.0
0.999 0.9 1.0 1.0
Result:
Raw: Even=500, Odd=500
Truncated: Even=500, Odd=500
Rounded simple: Even=500, Odd=500
Rounded Function: Even=505, Odd=495



--
components: Library (Lib)
messages: 372878
nosy: Carlos Neves, lemburg, mark.dickinson, rhettinger, stutzbach
priority: normal
severity: normal
status: open
title: Round built-in function not shows zeros acording significant figures and 
calculates different numbers of odd and even
type: behavior
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



[issue38980] Compile libpython with -fno-semantic-interposition

2020-07-02 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

and to echo others: Do not worry about LD_PRELOAD users trying to override 
internals.  That is not a supported use case.  It is always a hack.  anyone 
using it knows this.

--

___
Python tracker 

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



[issue41180] marshal load bypass code.__new__ audit event

2020-07-02 Thread Steve Dower


Steve Dower  added the comment:

Actually, a quick search of codeobject.c and a look at tkmk's PR makes it seem 
like the audit event should be being raised from inside 
PyCode_NewWithPosOnlyArgs anyway (which IIRC didn't exist when I first added 
the event, though it was probably there before it was merged).

In general, events should be raised after parameters have been validated, but 
before any work is done. And when all the other calls feed through a single 
function, just auditing that one function is enough.

--

___
Python tracker 

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



[issue41197] Async magic methods in contextlib.closing

2020-07-02 Thread Ramzan Bekbulatov


Ramzan Bekbulatov  added the comment:

In this case:

```python3
class A:
async def close(self):
pass

with closing(A()):
pass
```

Python will raise `RuntimeWarning: coroutine 'A.close' was never awaited`.

In another case:

```python3
class B:
def close(self):
pass

async with closing(B()):
pass
```

Python will raise `TypeError: object NoneType can't be used in 'await' 
expression` (because it will try to await result of close method).

-

I was surprised that `contextlib` has no async analogue of this `closing` 
class, because async scripts often use any kind of closings. Do you think it's 
better to extract to `asyncclosing` class?

--

___
Python tracker 

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



[issue33665] tkinter.ttk.Scrollbar.fraction() under-estimates length

2020-07-02 Thread E. Paine


Change by E. Paine :


Added file: https://bugs.python.org/file49293/ttkscrl.tcl

___
Python tracker 

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



[issue33665] tkinter.ttk.Scrollbar.fraction() under-estimates length

2020-07-02 Thread E. Paine


E. Paine  added the comment:

I agree that the `tkinter.ttk.Scrollbar.fraction` under-estimates the length of 
the trough and I have written a program to try to measure this precisely.

When tested (only on Linux, granted), this deficit was measured to be 9 pixels 
(unless I got the maths wrong!). Tcl/Tk gave **exactly** the same numbers when 
run using 'wish'.

Thank you pez for reporting this, but 2 years on it should be closed as third 
party (please do take it up with the tcl team if you feel it is a real issue).

--
nosy: +epaine
title: tkinter.ttk.Scrollbar.fraction() is inaccurate, or at least inconsistent 
compared to the non ttk version -> tkinter.ttk.Scrollbar.fraction() 
under-estimates length
versions: +Python 3.10, Python 3.9 -Python 3.6, Python 3.7
Added file: https://bugs.python.org/file49292/ttkscrl.py

___
Python tracker 

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



[issue41197] Async magic methods in contextlib.closing

2020-07-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

And what happen when you accidentally use synchronous "with" instead of "async 
with" with closing()?

with closing(SomeAPI()) as api:
...

I think it is intentionally that different functions/methods/classes are used 
for synchronous and asynchronous operations.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue41139] cgi uses the locale encoding for log files

2020-07-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Available options:

1. Do nothing (keep cgi.log() and continue to use the default encoding for 
open()).
2. Remove cgi.log(). I think that the deprecation period is not needed because 
the function is not documented, is not imported by star-import, and is not 
shown in help.
3. Make cgi.log() using UTF-8 for open(). This may break some existing code if 
cgi.log() is ever used.
4. Completely rewrite cgi.log() using the logging module.

In all options except 2 cgi.log() needs to be documented and advertised as a 
new feature. And we should ask ourself: do we need this feature? Does it have 
advantages over the logging package?

It was more visible in 2.0. But since adding __all__ in 2.1 (in 
e99d5ea25ba994491c773d9b5872332334ccd1c5) it is a hidden feature.

--

___
Python tracker 

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



[issue41197] Async magic methods in contextlib.closing

2020-07-02 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +yselivanov

___
Python tracker 

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



[issue12029] Allow catching virtual subclasses in except clauses

2020-07-02 Thread Simon Charette


Change by Simon Charette :


--
nosy: +charettes

___
Python tracker 

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



[issue41197] Async magic methods in contextlib.closing

2020-07-02 Thread Рамзан Б .

New submission from Рамзан Б. :

# Async magic methods in contextlib.closing

I think `__aenter__` and `__aexit__` methods should be added to 
`contextlib.closing`, so that we can use `contextlib.closing` in async code too.

For example:

```python3
class SomeAPI:
...

async def request(self):
pass

async def close(self):
await self.session.close()


async with closing(SomeAPI()) as api:
response = await api.request()
print(response)
```

Also these methods can be moved to another class (like `asyncclosing` along the 
lines of `asynccontextmanager`).

--
components: Library (Lib)
messages: 372871
nosy: Рамзан Б.
priority: normal
pull_requests: 20434
severity: normal
status: open
title: Async magic methods in contextlib.closing
type: enhancement
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue41139] cgi uses the locale encoding for log files

2020-07-02 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి

Srinivas  Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) 
 added the comment:

My bad. I meant cgi.log(), I pressed submit changes in a hurry.

+1 for utf-8.

--

___
Python tracker 

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



[issue41196] APPDATA directory is different in store installed python

2020-07-02 Thread aku911


aku911  added the comment:

This is causing this issue here:
https://github.com/microsoft/vscode-python/issues/11412

--

___
Python tracker 

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



[issue41196] APPDATA directory is different in store installed python

2020-07-02 Thread aku911


New submission from aku911 :

Install the windows store python then run this code:

import os
os.listdir(os.environ['APPDATA'])

Install another version of python and run the same code.

You'll get different results.

This can cause issues when trying to share data in a user's APPDATA folder.

--

___
Python tracker 

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



[issue41196] APPDATA directory is different in store installed python

2020-07-02 Thread aku911


Change by aku911 :


--
components: Windows
nosy: aku911, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: APPDATA directory is different in store installed python
type: behavior
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



[issue41139] cgi uses the locale encoding for log files

2020-07-02 Thread Ethan Furman


Ethan Furman  added the comment:

Which functionality?

- cgi.log()

- opening with current locale

I don't mind keeping the function, but if the file isn't already opened I think 
using UTF-8 is an appropriate choice.

--

___
Python tracker 

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



[issue41139] cgi uses the locale encoding for log files

2020-07-02 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి

Srinivas  Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) 
 added the comment:

I am for keeping this functionality. Unless others in this nosy list think 
otherwise.

--
nosy: +thatiparthy

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue32958] socket module calls with long host names can fail with idna codec error

2020-07-02 Thread Steve Bowman


Steve Bowman  added the comment:

When will this issue be fixed?  Thanks!

--
nosy: +sdbowman

___
Python tracker 

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



[issue41073] [C API] PyType_GetSlot() should accept static types

2020-07-02 Thread hai shi


hai shi  added the comment:

> You'll probably need some table like typeslots.inc to record which sub-slots 
> struct each slot belongs to.

Looks like it's a good way to solve this probleam, Let me try it ;)

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread STINNER Victor


STINNER Victor  added the comment:

I can reproduce the crash using the following script.py:
---
import gc; gc.set_threshold(5)
import sys

old_modules = dict(sys.modules)
sys.modules.clear()
sys.modules.update(old_modules)

import _ast
import gc
gc.collect()
---

And the command:
---
./python -i < script.py
---

PyInit__ast() is called twice. That's surprising: builtin extension modules 
should only be initialized once.

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

If I'm not wrong, this is the commit that introduced the regression.

commit ac46eb4ad6662cf6d771b20d8963658b2186c48c (HEAD -> bpo-x)
Author: Dino Viehland 
Date:   Wed Sep 11 10:16:34 2019 -0700

bpo-38113: Update the Python-ast.c generator to PEP384 (gh-15957)

Summary: This mostly migrates Python-ast.c to PEP384 and removes all 
statics from the whole file. This modifies the generator itself that generates 
the Python-ast.c. It leaves in the usage of _PyObject_LookupAttr even though 
it's not fully PEP384 compatible (this could always be shimmed in by anyone who 
needs it).

--
nosy: +dino.viehland

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Arcadiy Ivanov


Change by Arcadiy Ivanov :


--
components: +Interpreter Core
type:  -> crash

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +pablogsal

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

> old_modules = dict(sys.modules)
> sys.modules.clear()
> sys.modules.update(old_modules)

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

That's not an entirely accurate reproducer as the references to the modules are 
still held in the collection when the sys.modules.clear() is called.

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

A shorter reproducer;

>>> import sys
>>> sys.modules.clear()
Traceback (most recent call last):
  File "", line 1, in 
RuntimeError: lost builtins module
>>> import _ast
>>> import gc
>>> gc.collect()
Modules/gcmodule.c:114: gc_decref: Assertion "gc_get_refs(g) > 0" failed: 
refcount is too small
Enable tracemalloc to get the memory block allocation traceback

object address  : 0x7f4c22f843b0
object refcount : 2
object type : 0x5605f3385660
object type name: module
object repr : 

Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed
Python runtime state: initialized

Current thread 0x7f4c23a5d280 (most recent call first):
  File "", line 1 in 
[1]21945 abort (core dumped)  ./python

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

So as soon as I started using CPython 3.9.0b3 with debug, the stack trace 
changed and the corruption apparently occurs in the GC, probably because the 
assertion is triggered vs release-style build:

Modules/gcmodule.c:114: gc_decref: Assertion "gc_get_refs(g) > 0" failed: 
refcount is too small
Enable tracemalloc to get the memory block allocation traceback

object address  : 0x7f8566e1b110
object refcount : 1
object type : 0x85e160
object type name: module
object repr : 

Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed
Python runtime state: initialized

Current thread 0x7f85743c5740 (most recent call first):
  File "", line 587 in 
_compile_bytecode
  File "", line 918 in get_code
  File "", line 786 in exec_module
  File "", line 680 in _load_unlocked
  File "", line 986 in _find_and_load_unlocked
  File "", line 1007 in _find_and_load
  File 
"./src/main/python/pybuilder/_vendor/pkg_resources/extern/__init__.py", line 43 
in load_module
  File "", line 627 in 
_load_backward_compatible
  File "", line 664 in _load_unlocked
  File "", line 986 in _find_and_load_unlocked
  File "", line 1007 in _find_and_load
  File 
"./src/main/python/pybuilder/_vendor/pkg_resources/_vendor/packaging/requirements.py",
 line 9 in 
  File "", line 228 in 
_call_with_frames_removed
  File "", line 790 in exec_module
  File "", line 680 in _load_unlocked
  File "", line 986 in _find_and_load_unlocked
  File "", line 1007 in _find_and_load
  File "./src/main/python/pybuilder/extern/__init__.py", line 69 in 
load_module
  File "", line 627 in 
_load_backward_compatible
  File "", line 664 in _load_unlocked
  File "", line 986 in _find_and_load_unlocked
  File "", line 1007 in _find_and_load
  File "./src/main/python/pybuilder/_vendor/pkg_resources/__init__.py", 
line 84 in 
  File "", line 228 in 
_call_with_frames_removed
  File "", line 790 in exec_module
  File "", line 680 in _load_unlocked
  File "", line 986 in _find_and_load_unlocked
  File "", line 1007 in _find_and_load
  File "./src/main/python/pybuilder/extern/__init__.py", line 69 in 
load_module
  File "", line 627 in 
_load_backward_compatible
  File "", line 664 in _load_unlocked
  File "", line 986 in _find_and_load_unlocked
  File "", line 1007 in _find_and_load
  File "./src/main/python/pybuilder/pip_common.py", line 19 in 
  File "", line 228 in 
_call_with_frames_removed
  File "", line 790 in exec_module
  File "", line 680 in _load_unlocked
  File "", line 986 in _find_and_load_unlocked
  File "", line 1007 in _find_and_load
  File "./src/main/python/pybuilder/pluginloader.py", line 33 in 
  File "", line 228 in 
_call_with_frames_removed
  File "", line 790 in exec_module
  File "", line 680 in _load_unlocked
  File "", line 986 in _find_and_load_unlocked
  File "", line 1007 in _find_and_load
  File "./src/main/python/pybuilder/reactor.py", line 38 in 
  File "", line 228 in 
_call_with_frames_removed
  File "", line 790 in exec_module
  File "", line 680 in _load_unlocked
  File "", line 986 in _find_and_load_unlocked
  File "", line 1007 in _find_and_load
  File "./src/main/python/pybuilder/cli.py", line 37 in 
  File "", line 228 in 
_call_with_frames_removed
  File "", line 790 in exec_module
  File "", line 680 in _load_unlocked
  File "", line 986 in _find_and_load_unlocked
  File "", line 1007 in _find_and_load
  File "./src/main/python/pybuilder/__init__.py", line 32 in bootstrap
  File "/tmp/IntegrationTestSupportte4n5vz_/build.py", line 31 in 
  File 
"/home/arcivanov/.pyenv/versions/3.9.0b3-debug/lib/python3.9/runpy.py", line 87 
in _run_code
  File 
"/home/arcivanov/.pyenv/versions/3.9.0b3-debug/lib/python3.9/runpy.py", line 97 
in _run_module_code
  File 
"/home/arcivanov/.pyenv/versions/3.9.0b3-debug/lib/python3.9/runpy.py", line 
268 in run_path
  File 
"/home/arcivanov/Documents/src/arcivanov/pybuilder/src/integrationtest/python/smoke_itest_support.py",
 line 72 in smoke_test
  File 
"/home/arcivanov/Documents/src/arcivanov/pybuilder/src/integrationtest/python/smoke_clean_tests.py",
 line 30 in test_build_then_clean
  File 
"/home/arcivanov/.pyenv/versions/3.9.0b3-debug/lib/python3.9/unittest/case.py", 
line 550 in _callTestMethod
  File 
"/home/arcivanov/.pyenv/versions/3.9.0b3-debug/lib/python3.9/unittest/case.py", 
line 593 in run
  File 
"/home/arcivanov/.pyenv/versions/3.9.0b3-debug/lib/python3.9/unittest/case.py", 
line 653 in __call__
  File 
"/home/arcivanov/.pyenv/versions/3.9.0b3-debug/lib/python3.9/unittest/suite.py",
 line 122 in run
  File 
"/home/arcivanov/.pyenv/versions/3.9.0b3-debug/lib/python3.9/unittest/suite.py",
 line 84 in _

[issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration

2020-07-02 Thread STINNER Victor


STINNER Victor  added the comment:

Using https://github.com/sphinx-doc/sphinx/pull/7905 but without -W, I'm able 
to build the unmodified Python documentation with Sphinx 3!

I tried c_allow_pre_v3=1.

The PR was updated to add a second c_warn_on_allowed_pre_v3=0 option so we can 
keep -W.

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

To complete this report, this is a regression. This exact code runs perfectly 
in 2.7, 3.5 - 3.8.

This is the PR in Travis: 
https://travis-ci.org/github/pybuilder/pybuilder/builds/704312142

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

My guess is that the issue is related to the sys.modules manipulation, i.e. 
these parts of the integration test harness:

def smoke_test(self, *args):
old_argv = list(sys.argv)
del sys.argv[:]
sys.argv.append(self.build_py)
sys.argv.extend(args)

old_modules = dict(sys.modules)
old_meta_path = list(sys.meta_path)
old_cwd = getcwd()
chdir(self.tmp_directory)
try:
return run_path(self.build_py, run_name="__main__")
except SystemExit as e:
self.assertEqual(e.code, 0, "Test did not exit successfully")
finally:
del sys.argv[:]
sys.argv.extend(old_argv)

sys.modules.clear()
sys.modules.update(old_modules)

del sys.meta_path[:]
sys.meta_path.extend(old_meta_path)
chdir(old_cwd)

def smoke_test_module(self, module, *args):
old_argv = list(sys.argv)
del sys.argv[:]
sys.argv.append("bogus")
sys.argv.extend(args)

old_modules = dict(sys.modules)
old_meta_path = list(sys.meta_path)
old_cwd = getcwd()
chdir(self.tmp_directory)
try:
return run_module(module, run_name="__main__")
except SystemExit as e:
self.assertEqual(e.code, 0, "Test did not exit successfully")
finally:
del sys.argv[:]
sys.argv.extend(old_argv)

sys.modules.clear()
sys.modules.update(old_modules)

del sys.meta_path[:]
sys.meta_path.extend(old_meta_path)
chdir(old_cwd)

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

How to reproduce:

1. Clone github.com/pybuilder/pybuilder
2. Checkout https://github.com/pybuilder/pybuilder/pull/724
3. Run `PYTHONWARNINGS=ignore python ./build.py -v -X`

The failure occurs in the integration test smoke test in smoke_clean_tests.py

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

Once any of the integration tests run, the integration test environment is 
created and the test can be run directly from the command line via:

'.../pybuilder/target/venv/test/cpython-3.9.0.beta.3/bin/python' 
'.../pybuilder/src/integrationtest/python/smoke_clean_tests.py'

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

No C extensions, working on giving you a reproducer.

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread STINNER Victor


STINNER Victor  added the comment:

Can you please provide a reproducer? Does PyBuilder use C extensions?

--

___
Python tracker 

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



[issue41195] Interface to OpenSSL's security level

2020-07-02 Thread Matthew Hughes


Change by Matthew Hughes :


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

___
Python tracker 

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



[issue41183] Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures

2020-07-02 Thread Larry Hastings


Larry Hastings  added the comment:


New changeset f52bf62fe12d46267e958f80dbe1f4425b55cd0f by Christian Heimes in 
branch '3.5':
bpo-41183: Update finite DH params to 3072 bits (#21278)
https://github.com/python/cpython/commit/f52bf62fe12d46267e958f80dbe1f4425b55cd0f


--

___
Python tracker 

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



[issue41193] traceback when exiting on read-only file system

2020-07-02 Thread STINNER Victor


STINNER Victor  added the comment:

Well, two errors were already ignored (bpo-19891). I just made the "except" 
more generic. I don't think that we can do anything more useless than ignoring 
the error if the filesystem is read-only. I don't think that a warning would be 
useful.

--

___
Python tracker 

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



[issue41175] Static analysis issues reported by GCC 10

2020-07-02 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue41193] traceback when exiting on read-only file system

2020-07-02 Thread Zbyszek Jędrzejewski-Szmek

Zbyszek Jędrzejewski-Szmek  added the comment:

Wow, that was quick. Thanks!

--

___
Python tracker 

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



[issue41193] traceback when exiting on read-only file system

2020-07-02 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Zbyszek for your bug report. It's now fixed in 3.8, 3.9 and master 
branches.

--
components: +Library (Lib)
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



[issue41193] traceback when exiting on read-only file system

2020-07-02 Thread miss-islington


miss-islington  added the comment:


New changeset 0b4c87ef8f88a4c4c325e964fa4919cef3997605 by Miss Islington (bot) 
in branch '3.9':
bpo-41193: Ignore OSError in readline write_history() (GH-21279)
https://github.com/python/cpython/commit/0b4c87ef8f88a4c4c325e964fa4919cef3997605


--

___
Python tracker 

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



[issue41193] traceback when exiting on read-only file system

2020-07-02 Thread miss-islington


miss-islington  added the comment:


New changeset 53d2b715d10e5c81cb9c86fd25e88ace4e41bc25 by Miss Islington (bot) 
in branch '3.8':
bpo-41193: Ignore OSError in readline write_history() (GH-21279)
https://github.com/python/cpython/commit/53d2b715d10e5c81cb9c86fd25e88ace4e41bc25


--

___
Python tracker 

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



[issue41195] Interface to OpenSSL's security level

2020-07-02 Thread Matthew Hughes


Matthew Hughes  added the comment:

> Applications should not change this setting
> A read-only getter for the policy sounds like a good idea, though.

Thanks for the feedback, sounds reasonable to me. I'll happily work on getting 
a PR up for the read-only setter.

--

___
Python tracker 

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



[issue18080] setting CC no longer overrides default linker for extension module builds on OS X

2020-07-02 Thread Ned Deily


Ned Deily  added the comment:

Jason, what action(s) are you expecting with regard to this and by whom? This 
issue has been long closed.

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

If you aren't able to share some reproducer snippets, would you try a bisect? 
An interesting commit would be this ac46eb4ad66 to try and check if this crash 
happens before and after it?

--

___
Python tracker 

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



[issue41195] Interface to OpenSSL's security level

2020-07-02 Thread Christian Heimes


Christian Heimes  added the comment:

I'm not sure it's a good idea to expose a setter for security level. In general 
the security level is a system-wide policy decision that should be controlled 
by administrators. Applications should not change this setting.

Python libraries tend to follow bad practices and cargo cult when it comes to 
TLS settings. Many years ago OpenSSL and Linux distributions had bad default 
settings. Nowadays OpenSSL has good defaults and distributions often set even 
stricter defaults.

A read-only getter for the policy sounds like a good idea, though.

--

___
Python tracker 

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



[issue41193] traceback when exiting on read-only file system

2020-07-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20430
pull_request: https://github.com/python/cpython/pull/21281

___
Python tracker 

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



[issue41193] traceback when exiting on read-only file system

2020-07-02 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +20429
pull_request: https://github.com/python/cpython/pull/21280

___
Python tracker 

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



[issue41193] traceback when exiting on read-only file system

2020-07-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0ab917e07ed64c6bfde6f6e791f9b28acc97b510 by Victor Stinner in 
branch 'master':
bpo-41193: Ignore OSError in readline write_history() (GH-21279)
https://github.com/python/cpython/commit/0ab917e07ed64c6bfde6f6e791f9b28acc97b510


--

___
Python tracker 

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



[issue41195] Interface to OpenSSL's security level

2020-07-02 Thread Matthew Hughes


New submission from Matthew Hughes :

While investigating Python's SSL I noticed there was no interface for 
interacting with OpenSSL's SSL_CTX_{get,set}_security_level 
(https://www.openssl.org/docs/manmaster/man3/SSL_CTX_get_security_level.html) 
so I thought I'd look into adding one (see attached patch). I'd be happy to put 
up a PR, but I have node idea if this feature would actually be desired.

--
assignee: christian.heimes
components: SSL
files: add_ssl_context_security_level.patch
keywords: patch
messages: 372839
nosy: christian.heimes, mhughes
priority: normal
severity: normal
status: open
title: Interface to OpenSSL's security level
type: enhancement
Added file: 
https://bugs.python.org/file49291/add_ssl_context_security_level.patch

___
Python tracker 

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



[issue41162] Clear audit hooks after destructors

2020-07-02 Thread Frank


Change by Frank :


--
nosy: +frankli

___
Python tracker 

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



[issue41193] traceback when exiting on read-only file system

2020-07-02 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
nosy: +vstinner
nosy_count: 2.0 -> 3.0
pull_requests: +20428
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21279

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

I can say that it is always reproduced, both in Travis environment (Ubuntu) and 
in Fedora.

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

I'm right now rerunning the script with debug-level build of CPython and will 
report as soon as I have more data.
Any word on limits for attaching core dump?

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread STINNER Victor


STINNER Victor  added the comment:

Can you provide a script to reproduce the issue?

--
nosy: +vstinner

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

@arcivanov what kind of input do you pass to the compile function which leads 
this crash?

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

I can't seem to be able to attach a gziped coredump (7MB)

--

___
Python tracker 

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-02 Thread Arcadiy Ivanov


New submission from Arcadiy Ivanov :

Built with pyenv on Fedora 32. Discovered while testing PyBuilder for 3.9 
compatibility.

$ abrt gdb e6ad9db
GNU gdb (GDB) Fedora 9.1-5.fc32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.

For help, type "help".
Type "apropos word" to search for commands related to "word".
No symbol table is loaded.  Use the "file" command.
No symbol table is loaded.  Use the "file" command.
Reading symbols from 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.3/bin/python...
warning: exec file is newer than core file.
[New LWP 450349]
warning: Unexpected size of section `.reg-xstate/450349' in core file.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by 
`/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.'.
Program terminated with signal SIGSEGV, Segmentation fault.
warning: Unexpected size of section `.reg-xstate/450349' in core file.
#0  0x005d73d3 in init_types () at Python/Python-ast.c:1412
1412Python/Python-ast.c: No such file or directory.
>FromTo  Syms Read   Shared Object Library
0x7ff01d934050  0x7ff01d948d69  Yes (*) /lib64/libcrypt.so.2
0x7ff01d917af0  0x7ff01d926b95  Yes (*) /lib64/libpthread.so.0
0x7ff01d90b270  0x7ff01d90c1c9  Yes (*) /lib64/libdl.so.2
0x7ff01d9053f0  0x7ff01d905db0  Yes (*) /lib64/libutil.so.1
0x7ff01d7cd3d0  0x7ff01d868078  Yes (*) /lib64/libm.so.6
0x7ff01d619670  0x7ff01d76780f  Yes (*) /lib64/libc.so.6
0x7ff01d9a8110  0x7ff01d9c8574  Yes (*) /lib64/ld-linux-x86-64.so.2
0x7ff01d9740e0  0x7ff01d974fcc  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.3/lib/python3.9/lib-dynload/_heapq.cpython-39-x86_64-linux-gnu.so
0x7ff01d9963b0  0x7ff01d999b2a  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.3/lib/python3.9/lib-dynload/zlib.cpython-39-x86_64-linux-gnu.so
0x7ff01d97d5f0  0x7ff01d98abd8  Yes (*) /lib64/libz.so.1
0x7ff0101ed2d0  0x7ff0101ee31c  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.3/lib/python3.9/lib-dynload/_bz2.cpython-39-x86_64-linux-gnu.so
0x7ff0101a3570  0x7ff0101af996  Yes (*) /lib64/libbz2.so.1
0x7ff0101e3480  0x7ff0101e5dd6  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.3/lib/python3.9/lib-dynload/_lzma.cpython-39-x86_64-linux-gnu.so
0x7ff0101b99f0  0x7ff0101d1076  Yes (*) /lib64/liblzma.so.5
0x7ff01019d270  0x7ff01019dc02  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.3/lib/python3.9/lib-dynload/grp.cpython-39-x86_64-linux-gnu.so
0x7ff01018c5e0  0x7ff0101947f5  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.3/lib/python3.9/lib-dynload/math.cpython-39-x86_64-linux-gnu.so
0x7ff010185130  0x7ff010185e31  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.3/lib/python3.9/lib-dynload/_bisect.cpython-39-x86_64-linux-gnu.so
0x7ff01017d170  0x7ff010180ae1  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.3/lib/python3.9/lib-dynload/_sha512.cpython-39-x86_64-linux-gnu.so
0x7ff0101772c0  0x7ff0101781dd  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.3/lib/python3.9/lib-dynload/_random.cpython-39-x86_64-linux-gnu.so
0x7ff01009c570  0x7ff0100aa101  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.3/lib/python3.9/lib-dynload/_datetime.cpython-39-x86_64-linux-gnu.so
0x7ff01004d3f0  0x7ff0100528dc  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.3/lib/python3.9/lib-dynload/_json.cpython-39-x86_64-linux-gnu.so
0x7ff0100463d0  0x7ff010047953  Yes 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.3/lib/python3.9/lib-dynload/_posixsubprocess.cpython-39-x86_64-linux-gnu.so
0x7ff01003d3f0  0x7ff01

[issue41193] traceback when exiting on read-only file system

2020-07-02 Thread Zbyszek Jędrzejewski-Szmek

Change by Zbyszek Jędrzejewski-Szmek :


--
nosy: +asottile

___
Python tracker 

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



[issue41193] traceback when exiting on read-only file system

2020-07-02 Thread Zbyszek Jędrzejewski-Szmek

New submission from Zbyszek Jędrzejewski-Szmek :

[Originally reported as https://bugzilla.redhat.com/show_bug.cgi?id=1852941.]

$ touch ~/foo
touch: cannot touch '/home/fedora/foo': Read-only file system
$ python
Python 3.9.0b3 (default, Jun 10 2020, 00:00:00) 
[GCC 10.1.1 20200507 (Red Hat 10.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib64/python3.9/site.py", line 462, in write_history
readline.write_history_file(history)
OSError: [Errno 30] Read-only file system

Looking at /usr/lib64/python3.9/site.py, it already silently skips
PermissionError. If a user is running with the file system in ro mode,
they almost certainly are aware of the fact, since this is done either
on purpose or as a result of disk corruption, and the traceback from
python is not useful. Suppression of PermissionError was added in 
b2499669ef2e6dc9a2cdb49b4dc498e078167e26.

Version-Release number of selected component (if applicable):
python3-3.9.0~b3-1.fc33.x86_64

--
messages: 372832
nosy: zbysz
priority: normal
severity: normal
status: open
title: traceback when exiting on read-only file system
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue18080] setting CC no longer overrides default linker for extension module builds on OS X

2020-07-02 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

For easy reference, the relevant commit is 
https://github.com/python/cpython/commit/97345680dc.

--

___
Python tracker 

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



[issue41192] Some audit events are undocumented

2020-07-02 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +steve.dower

___
Python tracker 

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



[issue41165] [Python 3.10] Remove APIs deprecated long enough

2020-07-02 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> For the record, I noticed DeprecationWarning is not shown by unittest.runner 
> by default.

There is an open issue for this but I think it's enabled by default 
https://bugs.python.org/issue39892

$ cat /tmp/test_bar.py
import unittest
import warnings


class TestFoo(unittest.TestCase):

def test_foo(self):
self.assertEquals(1, 1)


if __name__ == "__main__":
unittest.main()

$ python3.8 -m unittest test_bar
/private/tmp/test_bar.py:8: DeprecationWarning: Please use assertEqual instead.
  self.assertEquals(1, 1)
.
--
Ran 1 test in 0.000s

OK

--

___
Python tracker 

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



[issue18080] setting CC no longer overrides default linker for extension module builds on OS X

2020-07-02 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

In [pypa/distutils#1](https://github.com/pypa/distutils/pull/1), I learned that 
the test doesn't have the intended effect. Patching `get_config_var()` has no 
effect because the function under test calls `get_config_vars()`. In some 
environments, such as PyPy3 as built on Homebrew, the first test fails.

--
nosy: +jaraco

___
Python tracker 

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



  1   2   >