#17308: Fix sws2rst
----------------------------+------------------------
Reporter: jdemeyer | Owner:
Type: defect | Status: new
Priority: minor | Milestone: sage-6.4
Component: scripts | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
----------------------------+------------------------
Comment (by kcrisman):
Are you suggesting something like the following?
{{{#!diff
diff --git a/src/bin/sage-sws2rst b/src/bin/sage-sws2rst
index 3028ef0..fc517b1 100755
--- a/src/bin/sage-sws2rst
+++ b/src/bin/sage-sws2rst
@@ -50,8 +50,8 @@ def process_sws(file_name):
sws_file = tarfile.open(file_name, mode='r:bz2')
#TODO: python complains about using tempnam, but I don't
#know hot to fix it or see any danger
-# tempname = os.tempnam('.')
- tempname = os.path.join(tempfile.gettempdir(), file_name)
+ tempname = os.tempnam('.')
+# tempname = os.path.join(tempfile.gettempdir(), file_name)
sws_file.extractall(tempname)
base_name = os.path.split(os.path.splitext(file_name)[0])[1]
base_name_clean = base_name.replace(' ','_')
@@ -180,10 +180,4 @@ if len(args) < 1:
for file_name in args:
print "Processing "+file_name
- try:
- process_sws(file_name)
- except Exception as e:
- print "Unable to process file ('%s')" % file_name
- print "Error message: %s" % e
- print "Exiting."
- sys.exit(1)
+ process_sws(file_name)
}}}
I don't know whether the assumption is incorrect, so I would rather not
remove it. Probably the guy who wrote sws2rst originally had problems
with it.
--
Ticket URL: <http://trac.sagemath.org/ticket/17308#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.