Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

[HELP - confirmation requested] truncated File -> Save As -> HTML conversion problem

瀏覽次數:3 次
跳到第一則未讀訊息

Chris Chiasson

未讀,
2007年7月23日 凌晨3:52:172007/7/23
收件者:
I have run across some odd behavior. When a notebook of any type is
above a certain length or size, the HTML conversion is just truncated.
This happens in V6, not V5. It *doesn't matter what version wrote the
notebook*, if V6 saves it to HTML and the notebook is long, the file
is truncated:

Simple Test Notebooks:

http://test.chris.chiasson.name/fuel-cell-electrochemistry/automaticnumbering.nb

http://test.chris.chiasson.name/fuel-cell-electrochemistry/automaticnumberingV5.nb


If yours doesn't truncate the html file, try increasing the number of
cells in the notebook (easy to do in automaticnumberingV5.nb b/c of
Print statement and Do loop).

My server computer's motherboard is fried, so I haven't had a chance
to try this on another machine. Note also that, to help isolate the
problem, I uninstalled Mathematica 6, deleted my C:\Documents and
Settings\Chris\Application Data\Mathematica directory, reinstalled
Mathematica 6 and rebooted. The problem still persists.

Is anyone else able to reproduce this? It is quite distressing...

I'm running 6.0.0 for students on Windows XP SP 2.

--
http://chris.chiasson.name/

David Reiss

未讀,
2007年7月24日 清晨6:12:152007/7/24
收件者:
(M 6) In[26]:= $Version

(M 6) Out[26]= "6.0 for Mac OS X x86 (32-bit) (June 19, 2007)"

I find the following:

If I execute

Export[
"/Users/dreiss/Desktop/chris/test.html",
CreateWindow@
DocumentNotebook[
Table[TextCell[ToString@i, "Text"], {i, 1, 1000}]],
"HTML"]

then the exported html file is complete.

However, if I create the notebook

CreateWindow@
DocumentNotebook[Table[TextCell[ToString@i, "Text"], {i, 1, 1000}]]

and then use the File>Save As menu command, and save as html, the
resulting html file is incomplete. The number of cells that it
achieves converting to html varies each time I try it, but is around
600.

Some other comments. If I use the SaveAs html menu item, and then
attempt to save the notebook again as html over the original file,
mathematica tells me that Export (which, of course is behind the Save
As command) cannot open the html file that I am trying to save to.

If one goes to that file, deletes it (ie throws it into the trash) and
then tries to empty the trash, the OS tells one that the file is stil
in use.

Aparently Mathematica still has the file open and so, the OS lets us
know that it is still in use.

This is an old old bug that I think(but am not sure) that I reported
somewhere in prehistory. The File>Save AS>html approach to html
conversion appears to not properly dispose of its connection to the
file that it is exporting to.

So, perhaps these multiple issues are connected in some way.

Since WRI reads these postings very diligently, I will assume that
this is a bug report and not submit it through ohter venues.

I think that the lesson here is that for real production work, one
should use Export directly rather than the less versatile menu command
approach.

--David
A WorkLife FrameWork
The first Mathematica-6 compatible add on
http://scientificarts.com/worklife

Chris Chiasson

未讀,
2007年7月25日 凌晨2:34:222007/7/25
收件者:
Bruce Miller from WRI Technical Support gave the same workaround. I
have also experienced the problem with the file not being "released"
or closed by Mathematica. I will probably file another report about it
with technical support just to make sure they know about it.


John Fultz

未讀,
2007年7月25日 清晨5:26:392007/7/25
收件者:
The problem is that Save As HTML operation is inappropriately getting
TimeConstrained wrapped around it because the internal method by which it works
shares an implementation with how Dynamics are evaluated (which quite
appropriately are TimeConstrained). So if the Export operation initiated by the FE is being halted mid-stream by TimeConstrained[].

So another way to work around this is to set the value of the
DynamicEvaluationTimeout option to be large enough to allow enough time to save
the HTML file. The downside to doing this is that increasing the value of this
option also increases the timeout for every Dynamic evaluation which may be in a hung state.

The problem is fixed for future incremental and major releases.

Sincerely,

John Fultz
jfu...@wolfram.com
User Interface Group
Wolfram Research, Inc.

0 則新訊息