Default python is 3.6?

Dima Pasechnik dimpase+freebsd at gmail.com
Fri Apr 12 19:19:45 UTC 2019


On Fri, Apr 12, 2019 at 6:29 PM Steve Kargl
<sgk at troutmask.apl.washington.edu> wrote:
>
> On Fri, Apr 12, 2019 at 09:17:42AM -0700, Steve Kargl wrote:
> >
> > % find . -name math\*
> > ./work/Python-3.6.8/Doc/library/math.rst
> > ./work/Python-3.6.8/Modules/mathmodule.c
> > ./work/Python-3.6.8/Lib/test/math_testcases.txt
> > ./work/stage/usr/local/lib/python3.6/test/math_testcases.txt
> >
>
> Well, this one is easy to fix.  I've sent this patch for 2 to 3
> years now.  I've opened a PR about it.  Someday you guys might
> actually fix this, because I will contacting core to get my
> commit bit back.
>
This one is fixed in Python 3.7:
https://github.com/python/cpython/blob/3.7/Modules/mathmodule.c
via this commit:
https://github.com/python/cpython/commit/4e6646fef5d2cc53422e4eca0b18201ed5a5c4b6

It is also fixed in Python 2.7.
See https://github.com/python/cpython/pull/12027 for details.
I've just asked whether upstream will consider backporting this to
Python 3.5 and 3.6.
If not, it would need to be done in FreeBSD only.







>
>
> --- work/Python-3.6.8/Modules/mathmodule.c.orig 2019-04-12 09:23:42.329350000 -0700
> +++ work/Python-3.6.8/Modules/mathmodule.c      2019-04-12 09:24:37.977029000 -0700
> @@ -67,7 +67,7 @@
>  static const double logpi = 1.144729885849400174143427351353058711647;
>
>  static double
> -sinpi(double x)
> +_freebsd_ports_are_broken_sinpi(double x)
>  {
>      double y, r;
>      int n;
> @@ -296,7 +296,7 @@
>         integer. */
>      if (absx > 200.0) {
>          if (x < 0.0) {
> -            return 0.0/sinpi(x);
> +            return 0.0/_freebsd_ports_are_broken_sinpi(x);
>          }
>          else {
>              errno = ERANGE;
> @@ -320,7 +320,7 @@
>      }
>      z = z * lanczos_g / y;
>      if (x < 0.0) {
> -        r = -pi / sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
> +        r = -pi / _freebsd_ports_are_broken_sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
>          r -= z * r;
>          if (absx < 140.0) {
>              r /= pow(y, absx - 0.5);
> @@ -390,7 +390,7 @@
>      r += (absx - 0.5) * (log(absx + lanczos_g - 0.5) - 1);
>      if (x < 0.0)
>          /* Use reflection formula to get value for negative x. */
> -        r = logpi - log(fabs(sinpi(absx))) - log(absx) - r;
> +        r = logpi - log(fabs(_freebsd_ports_are_broken_sinpi(absx))) - log(absx) - r;
>      if (Py_IS_INFINITY(r))
>          errno = ERANGE;
>      return r;
>
> --
> Steve
> _______________________________________________
> freebsd-ports at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe at freebsd.org"


More information about the freebsd-ports mailing list