Ticket #652 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

[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: Work issues:
Report Upstream: Reviewers:
Authors: Merged in:
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

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

Change History

comment:1 Changed 5 years ago by was

  • Milestone set to sage-2.9

comment:2 Changed 5 years ago by mabshoff

  • Milestone changed from sage-2.9 to sage-2.8.11

comment:3 Changed 5 years ago by was

  • Milestone changed from sage-2.9 to sage-2.8.12

comment:4 Changed 4 years ago by mabshoff

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

comment:5 Changed 4 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 4 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 4 years ago by ncalexan

comment:7 Changed 4 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 4 years ago by ncalexan

comment:8 Changed 4 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 4 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 4 years ago by mabshoff

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

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

Note: See TracTickets for help on using tickets.