Opened 11 years ago

Closed 11 years ago

#9661 closed defect (fixed)

pari(string) always returns a value, even when it should not

Reported by: jdemeyer Owned by: jdemeyer
Priority: major Milestone: sage-4.5.3
Component: interfaces Keywords:
Cc: Merged in: sage-4.5.3.alpha0
Authors: Jeroen Demeyer Reviewers: John Cremona
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by jdemeyer)

When executing a PARI command from Sage, a value of 0 is returned when None would be expected. For example, in a gp shell (say, started with sage -gp):

gp> kill(x)   /* No output */

But in Sage:

sage: pari('kill(x)')
0

It should be possible to fix this by checking for gnil (PARI's concept of None) as return value.

Attachments (1)

9661.patch (1.2 KB) - added by jdemeyer 11 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 11 years ago by jdemeyer

  • Description modified (diff)
  • Summary changed from pari(string) and gp(string) always returns a value, even when it should not to pari(string) always returns a value, even when it should not

Changed 11 years ago by jdemeyer

comment:2 Changed 11 years ago by jdemeyer

  • Description modified (diff)
  • Owner changed from was to jdemeyer

comment:3 Changed 11 years ago by jdemeyer

  • Authors set to Jeroen Demeyer

comment:4 Changed 11 years ago by jdemeyer

  • Status changed from new to needs_review

comment:5 follow-up: Changed 11 years ago by cremona

I'm testing this now on 4.5.2.rc0. Can you say why you included _sig_off ? (I do not claim to understand how Sage/pari signal handling works.) Without this patch there is a return with no _sig_off (unless the call to new_gen does that.)

comment:6 Changed 11 years ago by cremona

  • Status changed from needs_review to positive_review

Tests all pass on 4.5.2.rc0 (64-bit ubuntu).

comment:7 in reply to: ↑ 5 Changed 11 years ago by jdemeyer

  • Milestone changed from sage-4.6 to sage-4.5.3

Replying to cremona:

I'm testing this now on 4.5.2.rc0. Can you say why you included _sig_off ? (I do not claim to understand how Sage/pari signal handling works.) Without this patch there is a return with no _sig_off (unless the call to new_gen does that.)

It's exactly as you say, new_gen() calls _sig_off.

comment:8 Changed 11 years ago by mpatel

  • Merged in set to sage-4.5.3.alpha0
  • Resolution set to fixed
  • Reviewers set to John Cremona
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.