Opened 11 years ago

Last modified 11 years ago

#9636 closed defect

Catch output from PARI in Sage — at Version 3

Reported by: jdemeyer Owned by: was
Priority: major Milestone: sage-4.6
Component: interfaces Keywords:
Cc: leif, robertwb Merged in:
Authors: Jeroen Demeyer Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by jdemeyer)

The output from print() functions in libpari is directly written to stdout and is not caught by Sage. For example, the following doctest fails:

def printhello():
    """
    sage: printhello()
    hello
    """
    pari('print("hello")')

It gives

File "/home/jdemeyer/paritest.sage", line 3:
    sage: printhello()
Expected:
    hello
Got nothing

Luckily, libpari provides ways to redirect the output. There should a small Cython wrapper to direct the PARI output to sys.stdout.write().

Dependencies: #9661, #9343

Change History (3)

comment:1 Changed 11 years ago by jdemeyer

  • Milestone set to sage-4.6

comment:2 Changed 11 years ago by jdemeyer

  • Authors set to Jeroen Demeyer

comment:3 Changed 11 years ago by jdemeyer

  • Description modified (diff)
Note: See TracTickets for help on using tickets.