Skip Menu |

This queue is for tickets about the File-Slurp CPAN distribution.

Report information
The Basics
Id: 129791
Status: resolved
Priority: 0/
Queue: File-Slurp

People
Owner: cwhitener [...] gmail.com
Requestors: PMPERRY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 9999.21
Fixed in: (no value)



When trying to cpan > upgrade File::Slurp 9999.27 on Windows 10, Strawberry Perl 5.26, I receive the following error: t/tainted.t ................... can't write to '\tempe8UUZ': Permission denied at t/tainted.t line 26. # Looks like your test exited with 13 before it could output anything. t/tainted.t ................... Dubious, test returned 13 (wstat 3328, 0xd00) Failed 9/9 subtests tainted's line 22 is my $path = temp_file_path(); which is the $path used in line 26 open(my $fh, ">", $path) or die "can't write to '$path': $!"; In turn, temp_file_path appears to come from FileSlurpTest (line 17) use FileSlurpTest qw(temp_file_path trap_function trap_function_list_context); but I can't find where FileSlurpTest is coming from. Anyway, a temporary path such as \tempe8UUZ\ is apparently unwritable on Windows. Perhaps it should be created under .\?
On Sun Jun 09 11:55:05 2019, PMPERRY wrote: Show quoted text
> When trying to cpan > upgrade File::Slurp 9999.27 on Windows 10, > Strawberry Perl 5.26, I receive the following error: > > t/tainted.t ................... can't write to '\tempe8UUZ': > Permission denied at t/tainted.t line 26. > # Looks like your test exited with 13 before it could output anything. > t/tainted.t ................... Dubious, test returned 13 (wstat 3328, > 0xd00) > Failed 9/9 subtests > > tainted's line 22 is > > my $path = temp_file_path(); > > which is the $path used in line 26 > > open(my $fh, ">", $path) or die "can't write to '$path': $!"; > > In turn, temp_file_path appears to come from FileSlurpTest (line 17) > > use FileSlurpTest qw(temp_file_path trap_function > trap_function_list_context); > > but I can't find where FileSlurpTest is coming from. Anyway, a > temporary path such as \tempe8UUZ\ is apparently unwritable on > Windows. Perhaps it should be created under .\?
I got the same thing and tried an adminstator cmd prompt and succeeded. Hope it doesn't cause me troubles later. I also read this https://windowsreport.com/fatal-error-temporary-directory/
On Sun Jun 09 11:55:05 2019, PMPERRY wrote: Show quoted text
> When trying to cpan > upgrade File::Slurp 9999.27 on Windows 10, > Strawberry Perl 5.26, I receive the following error: > > t/tainted.t ................... can't write to '\tempe8UUZ': > Permission denied at t/tainted.t line 26. > # Looks like your test exited with 13 before it could output anything. > t/tainted.t ................... Dubious, test returned 13 (wstat 3328, > 0xd00) > Failed 9/9 subtests > > tainted's line 22 is > > my $path = temp_file_path(); > > which is the $path used in line 26 > > open(my $fh, ">", $path) or die "can't write to '$path': $!"; > > In turn, temp_file_path appears to come from FileSlurpTest (line 17) > > use FileSlurpTest qw(temp_file_path trap_function > trap_function_list_context); > > but I can't find where FileSlurpTest is coming from. Anyway, a > temporary path such as \tempe8UUZ\ is apparently unwritable on > Windows. Perhaps it should be created under .\?
Hi, FileSlurpTest is bundled in the test directory: https://metacpan.org/source/CAPOEIRAB/File-Slurp-9999.27/t/lib/FileSlurpTest.pm We make use of File::Temp to find your temporary directory and test using that directory. File::Temp uses File::Spec. File::Spec's tmpdir function is here https://metacpan.org/source/XSAWYERX/PathTools-3.75/lib/File/Spec/Win32.pm#L70 Thanks, Chase
Hi Everyone, Admin mode should not be necessary to run in either cmd or PowerShell. Can you let me know which Perl versions you're using, please? Strawberry Perl version would be helpful. Thanks, Chase
As stated before, Strawberry Perl 5.26 on Windows 10, running in a DOS Command Window. I am running as a normal user (sole user of this machine, so I don't know if I'm automatically granted any special powers). Here is the complete upgrade attempt: C:\Users\Phil>cpan Loading internal logger. Log::Log4perl recommended for better logging Unable to get Terminal Size. The Win32 GetConsoleScreenBufferInfo call didn't work. The COLUMNS and LINES environment variables didn't work. at C:\Strawberry\perl\vendor\lib/Term/ReadLine/readline.pm line 410. cpan shell -- CPAN exploration and modules installation (v2.27) Enter 'h' for help. Show quoted text
cpan> upgrade File::Slurp
Database was generated on Thu, 12 Sep 2019 14:57:40 GMT Package namespace installed latest in CPAN file File::Slurp 9999.19 9999.27 CAPOEIRAB/File-Slurp-9999.27.tar.gz Running install for module 'File::Slurp' Checksum for C:\STRAWB~1\cpan\sources\authors\id\C\CA\CAPOEIRAB\File-Slurp-9999.27.tar.gz ok Scanning cache C:\STRAWB~1\cpan\build for sizes ...........................................---------------------------------DONE < a bunch of old install stuff DEL from cpan\build\ > Configuring C/CA/CAPOEIRAB/File-Slurp-9999.27.tar.gz with Makefile.PL Checking if your kit is complete... Looks good Generating a gmake-style Makefile Writing Makefile for File::Slurp Writing MYMETA.yml and MYMETA.json CAPOEIRAB/File-Slurp-9999.27.tar.gz C:\Strawberry\perl\bin\perl.exe Makefile.PL -- OK Running make for C/CA/CAPOEIRAB/File-Slurp-9999.27.tar.gz cp lib/File/Slurp.pm blib\lib\File\Slurp.pm CAPOEIRAB/File-Slurp-9999.27.tar.gz C:\STRAWB~1\c\bin\gmake.exe -- OK Running make test for CAPOEIRAB/File-Slurp-9999.27.tar.gz "C:\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t t/00-report-prereqs.t ......... # # Versions for all modules listed in MYMETA.json (including optional ones): # # === Configure Requires === # # Module Want Have # ------------------- ---- ---- # ExtUtils::MakeMaker any 7.38 # # === Build Requires === # # Module Want Have # ------------------- ---- ---- # ExtUtils::MakeMaker any 7.38 # # === Test Requires === # # Module Want Have # -------------- ---- -------- # Carp any 1.50 # Exporter 5.57 5.73 # Fcntl any 1.13 # File::Basename any 2.85 # File::Spec 3.01 3.75 # File::Temp any 0.2309 # IO::Handle any 1.39 # POSIX any 1.76 # Scalar::Util 1.00 1.52 # Socket any 2.029 # Symbol any 1.08 # Test::More any 1.302168 # overload any 1.28 # strict any 1.11 # warnings any 1.37 # # === Runtime Requires === # # Module Want Have # -------------- ---- ------ # B any 1.68 # Carp any 1.50 # Errno any 1.28 # Exporter 5.57 5.73 # Fcntl any 1.13 # File::Basename any 2.85 # File::Spec 3.01 3.75 # File::Temp any 0.2309 # IO::Handle any 1.39 # POSIX any 1.76 # strict any 1.11 # warnings any 1.37 # t/00-report-prereqs.t ......... ok t/01-error_edit_file.t ........ ok t/01-error_edit_file_lines.t .. ok t/01-error_prepend_file.t ..... ok t/01-error_read_dir.t ......... ok t/01-error_read_file.t ........ ok t/01-error_write_file.t ....... ok t/append_null.t ............... ok t/binmode.t ................... ok t/data_glob.t ................. ok t/data_section.t .............. ok t/edit_file.t ................. ok t/error.t ..................... ok t/file_object.t ............... ok t/handle.t .................... ok t/inode.t ..................... skipped: skip inode test on windows t/large.t ..................... ok t/newline.t ................... ok t/no_clobber.t ................ ok t/original.t .................. ok t/paragraph.t ................. ok t/perms.t ..................... ok t/prepend_file.t .............. ok t/pseudo.t .................... ok t/read_dir.t .................. ok t/slurp.t ..................... ok t/stdin.t ..................... ok t/stringify.t ................. ok t/tainted.t ................... can't write to '\tempvu7vm': Permission denied at t/tainted.t line 26. # Looks like your test exited with 13 before it could output anything. t/tainted.t ................... Dubious, test returned 13 (wstat 3328, 0xd00) Failed 9/9 subtests t/write_file_win32.t .......... ok Test Summary Report ------------------- t/tainted.t (Wstat: 3328 Tests: 0 Failed: 0) Non-zero exit status: 13 Parse errors: Bad plan. You planned 9 tests but ran 0. Files=30, Tests=627, 9 wallclock secs ( 0.16 usr + 0.08 sys = 0.23 CPU) Result: FAIL Failed 1/30 test programs. 0/627 subtests failed. gmake: *** [Makefile:929: test_dynamic] Error 255 Lockfile removed. CAPOEIRAB/File-Slurp-9999.27.tar.gz C:\STRAWB~1\c\bin\gmake.exe test -- NOT OK //hint// to see the cpan-testers results for installing this module, try: reports CAPOEIRAB/File-Slurp-9999.27.tar.gz Stopping: 'install' failed for 'File::Slurp'. Failed during this command: CAPOEIRAB/File-Slurp-9999.27.tar.gz : make_test NO Show quoted text
cpan>
I suspect that the problem is trying to create an absolute directory path, rather than something relative to the pwd. You might look at other packages and see what they do if they need to create a directory somewhere.
After a bit of research, it's fixable by creating a directory called C:\temp. When running in Taint mode (why we need to continue the farce of Taint mode is beyond me) all of your environment variables are considered tainted and thus can't be used to determine your temporary directory of choice. If the default of C:\temp isn't there, it falls back even further to \ which is not a great choice on Windows, to be sure. I broke my setup by removing C:\temp to make it behave the same as you're experiencing. Here's me fixing it in the command prompt: C:\Users\genio\_psperl\_perls\perl64-5.26.3.1\perl\bin> set ... REDACTED ... HOMEDRIVE=C: HOMEPATH=\Users\genio LOCALAPPDATA=C:\Users\genio\AppData\Local OS=Windows_NT Path=C:\Users\genio\_psperl\_perls\perl64-5.26.3.1\perl\site\bin;C:\Users\genio\_psperl\_perls\perl64-5.26.3.1\perl\bin;C:\Users\genio\_psperl\_perls\perl64-5.26.3.1\c\bin;C:\Users\genio\_psperl;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\ PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW ... REDACTED ... TEMP=C:\Users\genio\AppData\Local\Temp TMP=C:\Users\genio\AppData\Local\Temp USERNAME=genio USERPROFILE=C:\Users\genio C:\Users\genio\_psperl\_perls\perl64-5.26.3.1\perl\bin> perl -MFile::Spec -E "say File::Spec->tmpdir" C:\Users\genio\AppData\Local\Temp C:\Users\genio\_psperl\_perls\perl64-5.26.3.1\perl\bin> perl -T -MFile::Spec -E "say File::Spec->tmpdir" \ C:\Users\genio\_psperl\_perls\perl64-5.26.3.1\perl\bin> mkdir C:\temp C:\Users\genio\_psperl\_perls\perl64-5.26.3.1\perl\bin> perl -T -MFile::Spec -E "say File::Spec->tmpdir" C:\temp So, in short: mkdir C:\temp cpan File::Slurp Thanks, Chase
Thanks for taking some time to look over this report. Indeed, creating a C:\temp directory and then running "cpan File::Slurp" /did/ result in a successful update. I haven't tried running "upgrade File::Slurp" from within the cpan processor (I presume that will have to wait for the next upgrade). If keeping a \temp directory around is necessary for a successful upgrade, can a reminder to that end be added to the package? (In case I forget by the time of your next upgrade). Looking over the Testers grid, I see a handful of test failures that seem to be the same (but different from this one), plus one that may be a Perl level (5.6) that's just too far back to warrant supporting. Since none of these affect me, I'll leave it to your discretion as to whether you want to deal with them. Depending on whether you want to make any change to the package, I'll leave this ticket open. Please go ahead and close it when you feel you're done with the issue.
I've gone on a one-man mission to rid the world of Taint mode once and for all. To that end, 9999.28 has been released that now skips Taint mode tests. Thanks for bearing with me as we found the problem; it should no longer be an issue moving forward. Thanks, Chase