Opened 3 years ago

Closed 3 years ago

#24836 closed defect (fixed)

py3: cleanup sage.interfaces.sage0

Reported by: embray Owned by:
Priority: major Milestone: sage-8.3
Component: python3 Keywords: interfaces
Cc: Merged in:
Authors: Erik Bray Reviewers: Vincent Delecroix
Report Upstream: N/A Work issues:
Branch: 0edc3bd (Commits, GitHub, GitLab) Commit: 0edc3bd7d17831caf9c1bbf4069a988808a2a336
Dependencies: Stopgaps:

Status badges

Description

Various cleanup and minor fixes to sage.interfaces.sage0.

The most significant issue here is again handling file opening/closing in such a way that we don't get ResourceWarnings in the tests.

I found the best way to do this was to ensure that when the remote sage loads a pickle it does so wrapped in a with open(...): block, but doing this required adding the ability to process multi-line statements.

Change History (9)

comment:1 Changed 3 years ago by embray

Last edited 3 years ago by embray (previous) (diff)

comment:2 Changed 3 years ago by embray

  • Status changed from new to needs_review

comment:3 Changed 3 years ago by embray

  • Milestone changed from sage-8.2 to sage-8.3

comment:4 Changed 3 years ago by vdelecroix

  • Reviewers set to Vincent Delecroix
  • Status changed from needs_review to needs_work

Two minor comments

  1. Instead of
    +        elif isinstance(init_code, list):
    +            init_code = list(init_code)
    
    I would rather use a else or adding a else that raises a TypeError.
  1. Do you mind changing (b">>> ") to b'>>>' for consistency?

comment:5 Changed 3 years ago by embray

I don't think that feature is used much if at all anyways, but I agree it should be better. It should also handle being passed a string...

comment:6 Changed 3 years ago by git

  • Commit changed from c7120ec0121d33a7b0b2833de694c0161deb990d to 0edc3bd7d17831caf9c1bbf4069a988808a2a336

Branch pushed to git repo; I updated commit sha1. New commits:

d872d78better argument handling for init_code
0edc3bdmore consistent use of single-quotes vs double-quotes

comment:7 Changed 3 years ago by embray

  • Status changed from needs_work to needs_review

comment:8 Changed 3 years ago by vdelecroix

  • Status changed from needs_review to positive_review

comment:9 Changed 3 years ago by vbraun

  • Branch changed from u/embray/python3/sage-interfaces-sage0 to 0edc3bd7d17831caf9c1bbf4069a988808a2a336
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.