Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Dancer CPAN distribution.

Report information
The Basics
Id: 84198
Status: patched
Priority: 0/
Queue: Dancer

People
Owner: Nobody in particular
Requestors: wyant [...] cpan.org
Cc:
AdminCc:

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



Subject: t/02_request/14_uploads.t fails under Perl 5.17.9 and above
Test t/02_request/14_uploads.t fails under Perl 5.17.9 and above with the errors t/02_request/14_uploads.t .. Strings with code points over 0xFF may not be mapped into in-memory file handles core - request - Unknown error reading input: Bad file descriptor at t/02_request/14_uploads.old line 59. # Looks like your test exited with 9 before it could output anything. t/02_request/14_uploads.old .. Dubious, test returned 9 (wstat 2304, 0x900) Failed 21/21 subtests It appears that with 5.17.9 Perl started enforcing the notion that a file is bytes (or octets, if you prefer) rather than characters, and therefore can not contain "characters" whose code is greater than 255. The attached patch fixes the problem, at least under relatively recent Perls. It is probably overly verbose, but I did not want to use any facilities that were not already in use in the test, to increase the chance that it would work under older Perls. The assigned severity reflects the fact that, though it prevents installation without a 'force', I believe the problem is with the test rather than with Dancer, and that the problem only manifests (so far!) in a development version of Perl.
... except that I forgot to attach the patch. Here it is.
Subject: Dancer-t-uploads.patch
--- t/02_request/14_uploads.old 2012-01-26 08:21:35.000000000 -0500 +++ t/02_request/14_uploads.t 2013-03-25 11:49:03.000000000 -0400 @@ -16,9 +16,20 @@ } my $filename = "some_\x{1A9}_file.txt"; +my $filename_as_bytes = $filename; +if ( $] >= 5.017009 ) { + # The following song-and-dance is because Perl has, in 5.17.9, + # started flagging wide characters in in-memory files as errors, to + # wit: + # Strings with code points over 0xFF may not be mapped into + # in-memory file handles + open my $out, '>:encoding(utf8)', \$filename_as_bytes; + print { $out } "some_\x{1A9}_file.txt"; + close $out; +} my $content = qq{------BOUNDARY -Content-Disposition: form-data; name="test_upload_file"; filename="$filename" +Content-Disposition: form-data; name="test_upload_file"; filename="$filename_as_bytes" Content-Type: text/plain SHOGUN
Patched into devel branch. Thanks!