Bug #46683 [Com]: fopen() file name in warning is upper cased if the arguments are invalid

From: Date: Mon, 26 Sep 2011 23:57:09 +0000
Subject: Bug #46683 [Com]: fopen() file name in warning is upper cased if the arguments are invalid
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-163904@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=46683&edit=1

 ID:                 46683
 Comment by:         tyrael@php.net
 Reported by:        ant@php.net
 Summary:            fopen() file name in warning is upper cased if the
                     arguments are invalid
 Status:             Assigned
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   win32 only
 PHP Version:        5.3CVS-2008-11-26 (snap)
 Assigned To:        pajoye
 Block user comment: N
 Private report:     N

 New Comment:

is this still an issue?


Previous Comments:
------------------------------------------------------------------------
[2009-08-14 13:10:14] pajoye@php.net

stupid! stupid! auto no feedback.

------------------------------------------------------------------------
[2009-03-12 01:00:00] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------
[2009-03-04 12:30:06] ant@php.net

Yes I agree the updated error message is better than the previous 
invalid argument message. On the subject of clear tests I don't 
actually find this test too bad. The code has logic to test a bunch 
of different conditions and so requires some eye balling to 
understand. Each iteration includes the current item (see below). 

I find this approach preferable to unrolling the loop and duplicating 
the code as I think that would make the test significantly less 
maintainable.

--c:\/--
file in root

--c:\fopen11.tmpdirTwo\/--
file in fopen11.tmpdirTwo

--c:\fopen11.tmpdirTwo\--
file in fopen11.tmpdirTwo

------------------------------------------------------------------------
[2009-03-02 21:06:42] pajoye@php.net

UNC path begins with \\, that's why it was necessary to upper case the path.

However, why do you expect an invalid argument in this case? Here is what I get, which makes more
sense (after the fix for the correct path in the error message):

018+ Warning: fopen(\\fopen_variation11.tmp): failed to open stream: No such file or directory in
ext\standard\test\file\fopen_variation11-win32.php on line 52
018- Warning: fopen(\\fopen_variation11.tmp): failed to open stream: Invalid argument in %s on line
%d
025+ Warning: fopen(/\fopen_variation11.tmp): failed to open stream: No such file or directory in
ext\standard\tests\file\fopen_variation11-win32.php on line 52
025- Warning: fopen(\\fopen_variation11.tmp): failed to open stream: Invalid argument in %s on line
%d



------------------------------------------------------------------------
[2009-03-02 20:28:05] pajoye@php.net

Side note:

Please (PLEASE!!) try to create tests we can read. Like having an index telling which iteration we
are or other similar tricks to ease the debugging. I already asked for cleaner tests many times on
php-qa, without much success :)

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=46683


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=46683&edit=1


Thread (10 messages)

« previous php.bugs (#163904) next »