Opened 15 years ago

Closed 15 years ago

#652 closed defect (fixed)

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

Reported by: John Voight Owned by: William Stein
Priority: blocker Milestone: sage-2.10.1
Component: interfaces Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

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 15 years ago.
ncalexan-652-updated.patch (3.6 KB) - added by ncalexan 15 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 15 years ago by William Stein

Milestone: sage-2.9

comment:2 Changed 15 years ago by Michael Abshoff

Milestone: sage-2.9sage-2.8.11

comment:3 Changed 15 years ago by William Stein

Milestone: sage-2.9sage-2.8.12

comment:4 Changed 15 years ago by Michael Abshoff

Milestone: sage-2.10sage-2.9.2
Priority: minorblocker

comment:5 Changed 15 years ago by Robert Bradshaw

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 15 years ago by ncalexan

Summary: .sage files destroy existing .py files[with patch, needs review] .sage files destroy existing .py files

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

Changed 15 years ago by ncalexan

Attachment: ncalexan-652.patch added

comment:7 Changed 15 years ago by ncalexan

Summary: [with patch, needs review] .sage files destroy existing .py files[with patch, with negative review] .sage files destroy existing .py files

DO NOT APPLY, THIS HAS TROUBLE WITH DIRECTORIES

Changed 15 years ago by ncalexan

Attachment: ncalexan-652-updated.patch added

comment:8 Changed 15 years ago by ncalexan

Summary: [with patch, with negative review] .sage files destroy existing .py files[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 15 years ago by Carl Witty

Summary: [with patch, needs review] .sage files destroy existing .py files[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 15 years ago by Michael Abshoff

Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.