[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-10-25 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset f6255a2ccb55a63194caf698f471c803c08be359 by Zackery Spytz in 
branch '3.8':
bpo-39871: Fix an error in a news entry (GH-21749)
https://github.com/python/cpython/commit/f6255a2ccb55a63194caf698f471c803c08be359


--

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-09-20 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +21378
pull_request: https://github.com/python/cpython/pull/22333

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-08-06 Thread miss-islington


miss-islington  added the comment:


New changeset fc354ca51d0b6f24f2871788dfa7e35c56129f8b by Miss Islington (bot) 
in branch '3.9':
bpo-39871: Fix an error in a news entry (GH-21749)
https://github.com/python/cpython/commit/fc354ca51d0b6f24f2871788dfa7e35c56129f8b


--

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-08-06 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +20905
pull_request: https://github.com/python/cpython/pull/21760

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-08-06 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 54636355805dd2877bb54fbad8d967e1ddd8b553 by Zackery Spytz in 
branch 'master':
bpo-39871: Fix an error in a news entry (GH-21749)
https://github.com/python/cpython/commit/54636355805dd2877bb54fbad8d967e1ddd8b553


--
nosy: +inada.naoki

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-08-05 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +20893
pull_request: https://github.com/python/cpython/pull/21749

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-14 Thread Mark Dickinson


Mark Dickinson  added the comment:

Zackery: Thanks for the fix! Now merged and backported to 3.8 and 3.7.

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-14 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset 4dcfe5f2e4bad8e03990de75d8d4ec20e8aa23b3 by Mark Dickinson in 
branch '3.7':
[3.7] bpo-39871: Fix possible SystemError in atan2, copysign and remainder 
(GH-18806) (GH-18990)
https://github.com/python/cpython/commit/4dcfe5f2e4bad8e03990de75d8d4ec20e8aa23b3


--

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-14 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset e634a8ac1f8a2904a2241b83fc5e4c9f40d5c7ca by Mark Dickinson in 
branch '3.8':
[3.8] bpo-39871: Fix possible SystemError in atan2, copysign and remainder 
(GH-18806) (GH-18989)
https://github.com/python/cpython/commit/e634a8ac1f8a2904a2241b83fc5e4c9f40d5c7ca


--

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-14 Thread Mark Dickinson


Change by Mark Dickinson :


--
pull_requests: +18337
pull_request: https://github.com/python/cpython/pull/18990

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-14 Thread Mark Dickinson


Change by Mark Dickinson :


--
pull_requests: +18336
pull_request: https://github.com/python/cpython/pull/18989

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-14 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset 5208b4b37953a406db0ed6a9db545c2948dde989 by Zackery Spytz in 
branch 'master':
bpo-39871: Fix possible SystemError in atan2, copysign and remainder (GH-18806)
https://github.com/python/cpython/commit/5208b4b37953a406db0ed6a9db545c2948dde989


--

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-06 Thread Zackery Spytz


Zackery Spytz  added the comment:

I have created a pull request to fix this issue.  Please consider taking a look.

--

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-06 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 2.0 -> 3.0
pull_requests: +18164
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/18806

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-06 Thread Mark Dickinson


Mark Dickinson  added the comment:

No problem; I'll likely pick it up (if no-one else does) in the next few days.

--
assignee:  -> mark.dickinson

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-06 Thread David Vo


David Vo  added the comment:

I'm currently rather busy with other work, but if this happens to still be open 
in a couple of months I might pick it up.

--

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-05 Thread Mark Dickinson


Mark Dickinson  added the comment:

@David: do you have any interest in creating a PR?

--

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-05 Thread Mark Dickinson


Mark Dickinson  added the comment:

Nice find. This affects not just copysign, but all of the math module functions 
that use FUNC2 under the hood. (I think that's just "remainder", "atan2" and 
"copysign".)

--

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-05 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +easy (C)
stage:  -> needs patch
versions: +Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-05 Thread David Vo


New submission from David Vo :

If math.copysign(x, y) is passed an x that cannot be converted to a float and a 
y that implements __float__() in Python, math.copysign() will raise a 
SystemError from the TypeError resulting from the attempted float conversion of 
x.

math.copysign() should probably return immediately if converting the first 
argument to a float raises an error.

Example:

>>> import math
>>> from fractions import Fraction
>>> float(Fraction(-1, 1))  # this is needed to avoid an AttributeError?
-1.0
>>> math.copysign((-1) ** 0.5, Fraction(-1, 1))
TypeError: can't convert complex to float

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.8/numbers.py", line 291, in __float__
return self.numerator / self.denominator
SystemError: PyEval_EvalFrameEx returned a result with an error set

--
components: Extension Modules
messages: 363477
nosy: auscompgeek
priority: normal
severity: normal
status: open
title: math.copysign raises SystemError with non-float x and custom y
type: behavior

___
Python tracker 

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