Re: LWP::Protocol::file is tripped up by a bug in -e
Gisle Aas <[email protected]> Sun, 22 Aug 2010 15:24:05 +0200
| Newsgroups | gmane.comp.lang.perl.modules.lwp |
|---|---|
| Message-ID | <[email protected]> |
I'm not convinced this is the right thing to do. How did the $path string end up utf8::upgraded() in the first place here? --Gisle On Sun, Aug 15, 2010 at 23:14, Father Chrysostomos <[email protected]> wrote: > Perl’s -e ignores the internal UTF8 flag. (See <http://rt.perl.org/rt3/Ticket/Display.html?id=77242>.) > > LWP::Protocol::file triggers this bug in this piece of code: > > # test file exists and is readable > unless (-e $path) { > return new HTTP::Response &HTTP::Status::RC_NOT_FOUND, > "File `$path' does not exist"; > } > > If you add > $path =~ /[^\0-\xff]/ or utf8::downgrade($path); # work around perl bug #77242 > before the ‘unless’ statement, it works. > >