Last modified: 2010-05-15 15:38:24 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T4178, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 2178 - Parsertests: Temp dir creation fails on Windows
Parsertests: Temp dir creation fails on Windows
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.5.x
PC All
: Normal minor with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-05-15 07:14 UTC by Michael Keppler
Modified: 2010-05-15 15:38 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
patch for CVS HEAD (687 bytes, patch)
2005-05-15 07:16 UTC, Michael Keppler
Details
HEAD patch for GlobalFunctions.php (624 bytes, patch)
2005-06-22 17:18 UTC, Zigger
Details

Description Michael Keppler 2005-05-15 07:14:58 UTC
The temporary directory in the parsertests is named so that it can only be
created on Unix Systems, but fails on Windows. Attached patch creates a
temporary directory on Windows only using the TMPDIR environment variable.
Comment 1 Michael Keppler 2005-05-15 07:16:03 UTC
Created attachment 537 [details]
patch for CVS HEAD
Comment 2 Brion Vibber 2005-05-15 07:24:05 UTC
Perhaps it would be cleaner to use TMPDIR if it's set, otherwise default to /tmp.
Is there any particular reason to specially try to detect Windows?
Comment 3 Michael Keppler 2005-05-15 07:41:19 UTC
Uuum. I reinvestigated the problem and saw the root cause is completely
different. mkdir() does not create recursive directories. On Windows the /tmp
directory does not exist and therefor the creation of /tmp/mwParser... fails. So
my patch worked with pure luck because on my system the TMPDIR variable is empty.
A better solution might be to simply create the /tmp directory, if it does not
exist. On Windows that will create a sub directory /tmp in the mediawiki
installation directory, if no TMPDIR is set. On my system this solution worked fine.
Comment 4 Michael Keppler 2005-05-15 07:46:08 UTC
Err. Another typo. :/
I meant to suggest creating the "tmp" directory, not the "/tmp" directory, e.g.
running "mkdir('tmp')".
Comment 5 Brion Vibber 2005-05-15 07:51:24 UTC
In general I'd prefer that the parser tests not mess with the file structure inside the wiki's own area.

My XP box has TMP and TEMP environment variables set, but not TMPDIR. TMPDIR seems to be the thing on *nix, though; a 
quick check through each? A wfTmpDir() might be in order to encapsulate this... I would have used tmpnam() but that 
creates the file, and we want a directory so it's a bit silly.
Comment 6 Brion Vibber 2005-05-15 10:38:51 UTC
Added wfTempDir() to check those environment vars; that should do it. Please confirm it actually works on Windows. :)
Comment 7 Michael Keppler 2005-05-15 15:10:14 UTC
I can confirm that it works on Windows now. And the group table issue is also
gone. Thanks.
Comment 8 Zigger 2005-06-22 17:17:45 UTC
Re-opening, as there is a typo in wfTmpDir() in HEAD, which causes the same
problem to occur if TMPDIR is not set.  Patch to follow.
Comment 9 Zigger 2005-06-22 17:18:33 UTC
Created attachment 636 [details]
HEAD patch for GlobalFunctions.php
Comment 10 Brion Vibber 2005-06-22 20:24:11 UTC
Whoops! Applied.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links