## Forum archive 2000-2006

### John Jones - can't find surePathToTmpFile in WW 1.9

by Arnold Pizer -
Number of replies: 0
 can't find surePathToTmpFile in WW 1.9 topic started 2/2/2004; 10:59:04 AMlast post 3/3/2004; 12:56:14 PM
 John Jones - can't find surePathToTmpFile in WW 1.9  2/2/2004; 10:59:04 AM (reads: 4634, responses: 16) We have a problem (basically from the original set0) which displays some graphs.  It worked fine in previous versions of WeBWorK, but with 1.9 it produces a pink screen and the message,ERROR caught by Translator while processing problem file:Library/ASU-topics/setIntroduction_to_WeBWorK/prob4/prob4.pg*Undefined subroutine &WeBWorK::PG::Translator::surePathToTmpFile called at /ud/webwork/base/system/courseScripts/dangerousMacros.pl line 946.*It seems to be there in IO.pl. When I added it to the list of macro files to beloaded, at the top of the file, I got an error of send_mail_to redefined at /ud/webwork/base/system/courseScripts/IO.plJohn <| Post or View Comments |>

 John Jones - Re: can't find surePathToTmpFile in WW 1.9  2/4/2004; 12:35:42 PM (reads: 4961, responses: 0) Hi, Just an addendum to the message above. While I have other troubles with 1.9 on some machines, the error above is from two machines with standard working versions of 1.9. Also, to go along with the Undefined subroutine message, I get the warning "The macro &surePathToTmpFile can't be found" produced by alias() in dangerousMacros. I am surprised this hasn't come up before. Is there anyone using 1.9? Do you have graphs in problems? Any call to imageRow or insertGraph should trigger the error. John <| Post or View Comments |>

 Arnold K. Pizer - Re: can't find surePathToTmpFile in WW 1.9  2/4/2004; 3:42:05 PM (reads: 4931, responses: 0) Hi John, At Rochester we have been using WW 1.9 since the summer and haven't seen this problem.  For example try http://webwork.math.rochester.edu/mth162/ which runs under FreeBSD. Also the graph problem in set 0 works fine on a linux redhat 9 system running a virgin version of 1.9.02.  The version we run on http://webwork.math.rochester has a few bug fixes installed (but none that should be related to surePathToTmpFile). A number of people are using 1.9 and  this error hasn't been reported. Arnie <| Post or View Comments |>

 John Jones - Re: can't find surePathToTmpFile in WW 1.9  2/4/2004; 4:55:35 PM (reads: 4938, responses: 1) OK, my mistake. I was using files from CVS. I thought cvs = "1.9 + enhancements". Perhaps it is a surprise that this (almost) works under WW 1. The problem seems to be in Translator.pm, which is in WebWorK/PG from cvs, but doesn't exist in 1.9. There is a comment in evaluate_modules  eval "package Main; require $_; import$_"; # change for WW1 Do you know what it should be changed to, or is this part really ok? There is also mention in Translator.pm of special treatment of functions from IO? This seems to be more likely to be the problem since that is where surePathToTmpFile is defined. John <| Post or View Comments |>

 John Jones - Re: can't find surePathToTmpFile in WW 1.9  2/5/2004; 12:56:57 AM (reads: 4870, responses: 0) For what it is worth, it is now working with a kludge in place of repeating the definition of surePathToTmpFile in Translator.pm.  The only change I needed to make to the function itself is to get the course directory with Global::getCourseTempDirectory(), which I suppose would be a no-no with WeBWorK 2.  John<| Post or View Comments |>

 Sam Hathaway - Re: can't find surePathToTmpFile in WW 1.9  2/5/2004; 2:07:01 PM (reads: 5307, responses: 0) The problem is that WW 1.9 doesn't know anything about IO.pl, so it doesn't load IO.pl when bootstrapping a Translator. This is because up until the 1.9 release, we had been using a different set of macro files for WW1 and WW2. The solution is to add calls to unrestricted_load("\${courseScriptsDirectory}IO.pl") in all the places in 1.9 where translation is done (processProblem8.pl, welcomeAction.pl). I'll do that in the CVS. The deal with that comment is that the call to runtime_use (commented out, one line prior) was replaced with the call to eval/package/require/import, since webwork 1 doesn't have a runtime_use utility function. Hence, this was a "change for WW1". <| Post or View Comments |>

 John Jones - Re: can't find surePathToTmpFile in WW 1.9  2/5/2004; 3:08:45 PM (reads: 4970, responses: 0) Hi, I downloaded the changed files from cvs to a system which is straight cvs of version 1. Calls to processProblem generate errors from redefining surePathToTmpFile and send_mail_to, (two of the functions in IO.pl). John<| Post or View Comments |>

 Michael Gage - Re: can't find surePathToTmpFile in WW 1.9  2/6/2004; 1:21:48 PM (reads: 4920, responses: 0) In response to John Jones:  OK, my mistake. I was using files from CVS. I thought cvs = "1.9 + enhancements". This is the way it's intended to work, however, it looks like there are a few tweaks in WW1.9 that didn't get put into the CVS. We'll try to track them down. --Mike <| Post or View Comments |>

 Sam Hathaway - Re: can't find surePathToTmpFile in WW 1.9  2/9/2004; 2:14:35 PM (reads: 4932, responses: 0) Ignore my previous explanation -- I was on the wrong track. It appears that WeBWorK 1.9 is unsuitable for use with the modular PG subsystem (in CVS). Several changes were made AFTER 1.9 was released that enable use of PG from CVS. Specifically, PGtranslator.pm was replaced with a stub, and calls to PGtranslator (in processProblem8.pl and welcomeAction.pl) were replaced with calls to WeBWorK::PG::Translator. The latest CVS (as of now) of both webwork 1 and pg are as stable as the 1.9 release, so you should be safe checking out from CVS. I've rolled back my changes to processProblem8.pl and welcomeAction.pl. Sorry about that. <| Post or View Comments |>

 John Jones - Re: can't find surePathToTmpFile in WW 1.9  2/13/2004; 10:26:39 AM (reads: 4931, responses: 0) But, the problem still exists, or is it just me? This may be stating the obvious, but it looks like a problem with namespaces. If a another loading of IO.pl is added, then there are warnings about redefining its functions.  On the other hand, the code from dangerousMacros seems to want WeBWorK::PG::Translator::surePathToTmpFile.  By defining surePathToTmpFile inside Translator, all is well - the function is found and there is no complaint about redefinition. To fix it, one would have to know if the function should be WeBWorK::PG::Translator::surePathToTmpFile or just surePathToTmpFile.John <| Post or View Comments |>

 Michael Gage - Re: can't find surePathToTmpFile in WW 1.9  2/13/2004; 11:36:52 AM (reads: 4910, responses: 0) Hi, I haven't had time to sort this out completely just yet, but here is what I have so far: surePathToTmpFile is defined in system/lib/PGtranslator.pm and in pg/lib/WeBWorK/PG/IO/WW1.pm and in pg/macros/IO.pl on our production machine where both WW2 and WW1.9 are working. The WW2 version is synched with the CVS. The webwork WW1.9 version is not connected to the CVS so I can't determine easily what the differences are between the CVS and our production version. Unfortunately that will have to be done by hand and will take some time. I get the same results on my experimental setup for which both WW2 and WW1.9 are linked to the CVS. (My experimental setup doesn't get much use in WW1.9 mode however.) I'll take a look further next week, but maybe the information above will help track down the problem. --Mike <| Post or View Comments |>

 John Jones - Re: can't find surePathToTmpFile in WW 1.9  2/13/2004; 11:55:52 AM (reads: 4926, responses: 0) Mike, After seeing Arnie's posting that WW 1.9 worked ok at Rochester, I downloaded the tarball for its last official release.  The pg/lib/WeBWorK directory is not there at all, and PGTranslator is more like the old one, instead of calling pg/lib/WeBWorK/Translator. These changes are definitely relevant to the problem above. John<| Post or View Comments |>

 Michael Gage - Re: can't find surePathToTmpFile in WW 1.9  2/13/2004; 12:31:26 PM (reads: 4934, responses: 0) I don't believe there will be any harm in continuing to have the pg/lib/WeBWorK directory in place -- you will need it for WW2. However use the old PGtranslator.pm . Sam or I will do some more work on the new version of PGtranslator that calls pg/lib/WeBWorK/Translator to make sure it is compatible with both WW2.0 and WW1.9. The chief reason for the change was to make the updates to features of Translator.pm available to WW1.9 without having to change code in two places. I think using the old PGtranslator.pm will solve your problems for now. --Mike <| Post or View Comments |>

 Sam Hathaway - Re: can't find surePathToTmpFile in WW 1.9  2/14/2004; 12:07:14 AM (reads: 4924, responses: 0) I'll be working on an update to WeBWorK 1.9 over the weekend that will clear this up and allow out-of-box use of a shared PG subsystem. <| Post or View Comments |>

 Sam Hathaway - Re: can't find surePathToTmpFile in WW 1.9  2/18/2004; 9:15:41 PM (reads: 4944, responses: 0) I've released WW 1.9.03. In testing the release, I didn't run into any of the above problems. If you use this release, let me know if it works for you. You can download the tarball, or update CVS to revision rel-1-9-03. <| Post or View Comments |>

 John Jones - Re: can't find surePathToTmpFile in WW 1.9  2/19/2004; 12:09:23 PM (reads: 4931, responses: 0) I downloaded cvs of pg and webwork to overwrite my test system for this.  The only file I touched was Global.pm, where I merged the new lines into the old copy (which has paths to executables set).  I still get the same error for pages with graphs. Maybe I inadvertently missed some step in the installation process - but that would be curious since this seems to be the only place it shows, and my clunky fix is holding up on the real server using this system. Since 1.9.03 was just released, I'll wait and see if it works smoothly for others before delving into my setup further. Thanks for taking the time to get 1.9.03 put together. John<| Post or View Comments |>

 Sam Hathaway - Re: can't find surePathToTmpFile in WW 1.9  3/3/2004; 12:56:14 PM (reads: 4877, responses: 0) John, It would help me to diagnose your problem if I could take a look at your installation. Would you mind sending me a tarball of your test installation (minus courses), a copy of httpd.conf, and the output of `perl -V', (for the perl being used by WeBWorK)? <| Post or View Comments |>