Opened 12 years ago

Closed 12 years ago

#652 closed defect (fixed)

[with patch, with positive review] .sage files destroy existing .py files

Reported by: jvoight Owned by: was
Priority: blocker Milestone: sage-2.10.1
Component: interfaces Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

If files a.sage and a.py exist in a directory, then

sage: load a.sage

destroys the file a.py and replaces it with an automatically generated file. Either users should be warned of this "feature" or something else should be done.

Attachments (2)

ncalexan-652.patch (3.4 KB) - added by ncalexan 12 years ago.
ncalexan-652-updated.patch (3.6 KB) - added by ncalexan 12 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 12 years ago by was

  • Milestone set to sage-2.9

comment:2 Changed 12 years ago by mabshoff

  • Milestone changed from sage-2.9 to sage-2.8.11

comment:3 Changed 12 years ago by was

  • Milestone changed from sage-2.9 to sage-2.8.12

comment:4 Changed 12 years ago by mabshoff

  • Milestone changed from sage-2.10 to sage-2.9.2
  • Priority changed from minor to blocker

comment:5 Changed 12 years ago by robertwb

Is there any reason to put the .py files in the same directory? It would probably be less confusing to just put them in temp. If one wants to see them, one can use sage -preparse.

I'm having trouble finding where exactly these files are getting written/used.

comment:6 Changed 12 years ago by ncalexan

  • Summary changed from .sage files destroy existing .py files to [with patch, needs review] .sage files destroy existing .py files

Patch preparses .sage files to temporary .py files in a temp directory.

Changed 12 years ago by ncalexan

comment:7 Changed 12 years ago by ncalexan

  • Summary changed from [with patch, needs review] .sage files destroy existing .py files to [with patch, with negative review] .sage files destroy existing .py files

DO NOT APPLY, THIS HAS TROUBLE WITH DIRECTORIES

Changed 12 years ago by ncalexan

comment:8 Changed 12 years ago by ncalexan

  • Summary changed from [with patch, with negative review] .sage files destroy existing .py files to [with patch, needs review] .sage files destroy existing .py files

Updated patch should work -- the issue was that 'load /abs/dir/tofile.sage' was borked. Hopefully this works better.

comment:9 Changed 12 years ago by cwitty

  • Summary changed from [with patch, needs review] .sage files destroy existing .py files to [with patch, with positive review] .sage files destroy existing .py files

I reproduced the problem with the previous code, and the patch does fix the problem; and the code looks good.

comment:10 Changed 12 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from new to closed

Merged ncalexan-652-updated.patch in Sage 2.10.1.rc1

Note: See TracTickets for help on using tickets.