Opened 4 years ago

Closed 3 years ago

#24561 closed defect (duplicate)

py3: fix bugs in pynac with handling Python 3 ints

Reported by: embray Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: python3 Keywords: pynac
Cc: chapoton, rws Merged in:
Authors: Reviewers:
Report Upstream: Fixed upstream, in a later stable release. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Change History (9)

comment:1 Changed 4 years ago by embray

  • Report Upstream changed from N/A to Reported upstream. No feedback yet.

comment:2 Changed 4 years ago by embray

  • Report Upstream changed from Reported upstream. No feedback yet. to Reported upstream. Developers acknowledge bug.

comment:3 Changed 4 years ago by embray

  • Report Upstream changed from Reported upstream. Developers acknowledge bug. to Fixed upstream, but not in a stable release.

comment:4 follow-up: Changed 4 years ago by embray

There is another bug I just found that only cropped up once I rebased my Python 3 branch to include #24247.

The problem seems to lie in the assumption of all Python integer-like values will be successfully converted to a native int type (either long or mpz_t). Otherwise methods like numeric::is_small_power don't work properly, and some other things break down too.

comment:5 in reply to: ↑ 4 Changed 4 years ago by rws

Replying to embray:

There is another bug I just found that only cropped up once I rebased my Python 3 branch to include #24247.

The problem seems to lie in the assumption of all Python integer-like values will be successfully converted to a native int type (either long or mpz_t). Otherwise methods like numeric::is_small_power don't work properly, and some other things break down too.

Actually numeric::is_small_power is called only once (from log_eval) and Python numerics are not down-converted at all. So, to be able to confirm the bug you better please give me the concrete example.

comment:6 Changed 4 years ago by embray

Maybe that's not exactly it, but there was something like that. Basically the issue is that Python 2 longs / Python 3 ints were staying as Python objects and not being converted to either a C long or mpz_t. I have a patch I just forgot to post it.

comment:7 Changed 4 years ago by embray

  • Description modified (diff)

comment:8 Changed 3 years ago by chapoton

  • Milestone changed from sage-8.2 to sage-duplicate/invalid/wontfix
  • Report Upstream changed from Fixed upstream, but not in a stable release. to Fixed upstream, in a later stable release.
  • Status changed from new to needs_review

#24668 updates pynac, so we can close this one maybe ?

comment:9 Changed 3 years ago by jdemeyer

  • Resolution set to duplicate
  • Status changed from needs_review to closed
Note: See TracTickets for help on using tickets.