cosimo / perl6-lwp-simple Goto Github PK
View Code? Open in Web Editor NEWLWP::Simple quick & dirty implementation for Rakudo Perl 6
Home Page: http://www.streppone.it/cosimo/blog/tag/LWP::Simple/
LWP::Simple quick & dirty implementation for Rakudo Perl 6
Home Page: http://www.streppone.it/cosimo/blog/tag/LWP::Simple/
Perl6 LWP::Simple ================= http://github.com/cosimo/perl6-lwp-simple/ This is a quick & dirty implementation of a LWP::Simple clone for Rakudo Perl 6. Since Perl 6 is a bit new, this LWP::Simple does both get and post requests. Dependencies ============ LWP::Simple depends on the modules MIME::Base64 and URI, which you can find at http://modules.perl6.org/ Current status ============== As of 2011-04-22, runs with all recent rakudo builds. It correctly follows redirects, but no infinite redirects detection yet.
$ perl6 -e 'use LWP::Simple; say LWP::Simple.post("localhost")';
No such method 'lc' for invocant of type 'Any'
in method scheme at /Users/bbkr/Developer/Perl6/rakudo/install/lib/parrot/4.6.0/languages/perl6/lib/URI.pm:138
in method parse_url at /Users/bbkr/Developer/Perl6/rakudo/install/lib/parrot/4.6.0/languages/perl6/lib/LWP/Simple.pm:211
in method request_shell at /Users/bbkr/Developer/Perl6/rakudo/install/lib/parrot/4.6.0/languages/perl6/lib/LWP/Simple.pm:46
in method post at /Users/bbkr/Developer/Perl6/rakudo/install/lib/parrot/4.6.0/languages/perl6/lib/LWP/Simple.pm:39
in block <anon> at -e:1
Issue trying to use this with this code:
https://gist.github.com/840081
Nominal type check failed for parameter '$resp'; expected Str but got Failure instead
This key does not exist directly under $_PERL any more (used in method request_shell), and thus creates a warning each request. $_PERL or something silences it.
For some reason, for urls with slashes @path was like [[blah, blah, blah]], and joining it with / did not give the expected behaviour. Here's the patch that fixes it:
--- a/lib/LWP/Simple.pm
+++ b/lib/LWP/Simple.pm
@@ -17,10 +17,10 @@ class LWP::Simple {
my ($path, @path);
my $port;
- ($proto, $hostname, @path) = $url.split(/\/+/);
+ ($proto, $hostname, $path) = $url.split(/\/+/, 3);
$proto .= chop;
- $path = '/' ~ @path.join('/');
+ $path = '/' ~ $path;
($hostname, $port) = $hostname.split(':');
if ! $port {
Hope this helps.
===> Testing: LWP::Simple:ver<0.106>:authgithub:perl6
===> Testing [FAIL]: LWP::Simple:ver<0.106>:authgithub:perl6
rakudo $ git describe
2019.07.1-398-gf3dda96a8
This same error has occurred with several recent Rakudo builds, but I haven't bisected when it failed (or in fact whether the fault lies in Rakudo, LWP::Simple, or some outside state).
When parsing a url ( method parse_url() ) with two slashes ( ie. "//" ) parsing the url produces unexpected results:
eg. To create a tiny url that shortens the url http://digg.com
http://tinyurl.com/api-create.php?url=http://digg.com
@path = $url.split(//+/);
This will seperate the url into ("http:", "tinyurl.com/api-create.php?url=http:", digg.com)
$path = '/' ~ @path.join('/');
This will join the path back as:
tinyurl.com/api-create.php?url=http:/digg.com
basically, the url parsing doesn't work where there are 2 slashes in the url anywhere after the scheme
zef never completes install of LWP::Simple on older MacOS machine, stalls on 'testing' with 100% CPU utilization:
user@mbook:~$ ~/rakudo/rakudo-2020.10/zef/bin/zef install LWP::Simple
===> Searching for: LWP::Simple
===> Updating cpan mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan1.json
===> Updating p6c mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/p6c1.json
===> Updated p6c mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/p6c1.json
===> Updated cpan mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan1.json
===> Testing: LWP::Simple:ver<0.106>:auth<github:perl6>
^C
~$ ~/rakudo/rakudo-2020.10/zef/bin/zef install LWP::Simple --force
===> Searching for: LWP::Simple
===> Testing: LWP::Simple:ver<0.106>:auth<github:perl6>
^C
user@mbook:~$
The above error now comes out for the current version of rakudo because the Str object no longer supports the .bytes method and IO::Socket::INET.recv() returns a string not a buffer. A hacky fix just changing .bytes to .chars might work but it may be better to use read() rather than recv() to get back a byte oriented buffer or wait for some planned parrot changes that may allow recv to return a buffer again. I am currently working on a read() based solution to this.
Originally found in: https://github.com/coke/rakudo-star-daily/blob/master/log/MoarVM-test-modules.log
Test Summary Report
-------------------
t/get-w3-latin1-utf8.t (Wstat: 139 Tests: 1 Failed: 0)
Non-zero wait status: 139
Parse errors: No plan found in TAP output
Files=13, Tests=54, 24 wallclock secs ( 0.07 usr 0.01 sys + 16.97 cusr 1.58 csys = 18.63 CPU)
Result: FAIL
It simply doesn't work:
use LWP::Simple;
my $url = "htttp://tried.alot.of.them";
LWP::Simple.getprint($url);
the output: True
EDIT: Sorry, there was a demon in my machine, seems to work as expected now.
It looks from the code like it is just pulling down one packet. For example if you
perl6 -MLWP::Simple -e 'say LWP::Simple.get("http://perlcabal.org/syn/S02.html");'
you just get back the top of the page. I am tempted to add this as test case with a match on something at the bottom of the page to verify we pulled the whole thing.
Ron
Apparently only post
accepts header fields. get
method accepts only a URL and no header fields.
I'm guessing the http://jigsaw.w3.org/HTTP/300/301.html url in the test is now being redirected to a https url? This was from a fresh 'rakudobrew build moar; rakudobrew build panda; panda install Task::Star`.
==> Testing LWP::Simple
t/000-load-module.t ............. ok
t/basic-auth.t .................. ok
t/custom-headers-and-content.t .. ok
t/get-binary-camelia.t .......... ok
t/get-chunked-6guts.t ........... ok
t/get-perl6-org.t ............... ok
t/get-unsized.t ................. ok
t/get-w3-latin1-utf8.t .......... ok
501 Protocol scheme 'https' is not supported URL:https://jigsaw.w3.org/HTTP/300/Overview.html
in method request_shell at lib/LWP/Simple.pm:40
in block at lib/LWP/Simple.pm:84
in method request_shell at lib/LWP/Simple.pm:68
in method get at lib/LWP/Simple.pm:28
in block at t/get-w3-redirect.t:7
t/get-w3-redirect.t .............
No subtests run
t/getstore.t .................... ok
t/parse-url.t ................... ok
t/socket-sanity.t ............... ok
t/stringify-headers.t ........... ok
t/get-w3-redirect.t (Wstat: 0 Tests: 0 Failed: 0)
Parse errors: No plan found in TAP output
Files=13, Tests=54, 10 wallclock secs ( 0.03 usr 0.00 sys + 5.04 cusr 0.27 csys = 5.34 CPU)
Result: FAIL
LWP::Simple tests abort with "Cannot call 'match'; none of these signatures match" error. Results of "panda install LWP::Simple" follow:
==> Fetching LWP::Simple
==> Building LWP::Simple
Compiling lib/LWP/Simple.pm
==> Testing LWP::Simple
t/000-load-module.t ............. ok
t/basic-auth.t .................. ok
t/custom-headers-and-content.t .. Cannot call 'match'; none of these signatures match:
:(Cool:D : $target, *%adverbs)
in method match at src/gen/CORE.setting:2394
in block at t/custom-headers-and-content.t:12
t/custom-headers-and-content.t .. Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
t/get-binary-camelia.t .......... ok
t/get-chunked-6guts.t ........... ok
t/get-perl6-org.t ............... ok
t/get-unsized.t ................. Cannot call 'match'; none of these signatures match:
:(Cool:D : $target, *%adverbs)
in method match at src/gen/CORE.setting:2394
in block at t/get-unsized.t:10
t/get-unsized.t ................. Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
t/get-w3-latin1-utf8.t .......... ok
t/get-w3-redirect.t ............. ok
t/getstore.t .................... ok
t/parse-url.t ................... ok
t/socket-sanity.t ............... ok
t/stringify-headers.t ........... ok
Test Summary Report
-------------------
t/custom-headers-and-content.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/get-unsized.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
Files=13, Tests=54, 95 wallclock secs ( 0.12 usr 0.01 sys + 88.25 cusr 2.71 csys = 91.09 CPU)
Result: FAIL
test stage failed for LWP::Simple: Tests failed
Similar errors exist for LWP::Simple as it appears in the current Rakudo Star repository -- see rakudo/star#18 .
Pm
This test is fetching a URL http://6guts.wordpress.com/2012/07/29/rakudo-qast-switch-brings-memory-reductions/ which redirects to HTTPS. This requires IO::Socket::SSL (which isn't installing for me), so we probably should pick a different URL to try.
Testing modules/perl6-lwp-simple with /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/bin/perl6-j...
t/000-load-module.t ............. ok
java.lang.NullPointerException
in sub scheme_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI/DefaultPort.pm:32
in method default_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:150
in method port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:160
in method parse_url at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:309
in block at t/basic-auth.t:11
t/basic-auth.t ..................
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
java.lang.NullPointerException
in sub scheme_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI/DefaultPort.pm:32
in method default_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:150
in method port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:160
in method parse_url at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:309
in method request_shell at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:40
in method post at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:33
in block at t/custom-headers-and-content.t:9
t/custom-headers-and-content.t ..
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
java.lang.NullPointerException
in sub scheme_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI/DefaultPort.pm:32
in method default_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:150
in method port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:160
in method parse_url at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:309
in method request_shell at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:40
in method get at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:29
in block at t/get-binary-camelia.t:7
t/get-binary-camelia.t ..........
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
java.lang.NullPointerException
in sub scheme_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI/DefaultPort.pm:32
in method default_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:150
in method port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:160
in method parse_url at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:309
in method request_shell at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:40
in method get at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:29
in block at t/get-chunked-6guts.t:8
t/get-chunked-6guts.t ...........
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
java.lang.NullPointerException
in sub scheme_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI/DefaultPort.pm:32
in method default_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:150
in method port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:160
in method parse_url at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:309
in method request_shell at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:40
in method get at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:29
in block at t/get-perl6-org.t:7
t/get-perl6-org.t ...............
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
java.lang.NullPointerException
in sub scheme_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI/DefaultPort.pm:32
in method default_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:150
in method port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:160
in method parse_url at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:309
in method request_shell at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:40
in method get at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:29
in block at t/get-unsized.t:8
t/get-unsized.t .................
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
java.lang.NullPointerException
in sub scheme_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI/DefaultPort.pm:32
in method default_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:150
in method port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:160
in method parse_url at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:309
in method request_shell at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:40
in method get at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:29
in block at t/get-w3-latin1-utf8.t:6
t/get-w3-latin1-utf8.t ..........
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
java.lang.NullPointerException
in sub scheme_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI/DefaultPort.pm:32
in method default_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:150
in method port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:160
in method parse_url at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:309
in method request_shell at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:40
in method get at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:29
in block at t/get-w3-redirect.t:7
t/get-w3-redirect.t .............
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
java.lang.NullPointerException
in sub scheme_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI/DefaultPort.pm:32
in method default_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:150
in method port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:160
in method parse_url at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:309
in method request_shell at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:40
in method get at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:29
in method getstore at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:283
in block at t/getstore.t:11
t/getstore.t ....................
Dubious, test returned 1 (wstat 256, 0x100)
Failed 4/4 subtests
java.lang.NullPointerException
in sub scheme_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI/DefaultPort.pm:32
in method default_port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:150
in method port at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/URI.pm:160
in method parse_url at /home/coke/sandbox/rakudo-star-daily/star-jvm/rakudo-star-daily/install/languages/perl6/lib/LWP/Simple.pm:309
in block at t/parse-url.t:38
t/parse-url.t ...................
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
t/socket-sanity.t ............... ok
t/stringify-headers.t ........... ok
Test Summary Report
-------------------
t/basic-auth.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/custom-headers-and-content.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/get-binary-camelia.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/get-chunked-6guts.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/get-perl6-org.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/get-unsized.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/get-w3-latin1-utf8.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/get-w3-redirect.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/getstore.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: Bad plan. You planned 4 tests but ran 0.
t/parse-url.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
Files=13, Tests=9, 224 wallclock secs ( 0.05 usr 0.02 sys + 356.17 cusr 10.99 csys = 367.23 CPU)
Result: FAIL
The following test failure occurred upon installation of version
2015.03 of Task::Star (it did not occur with the previous version):
==> Fetching LWP::Simple
==> Building LWP::Simple
Compiling lib/LWP/Simple.pm to mbc
==> Testing LWP::Simple
t/000-load-module.t ............. ok
t/basic-auth.t .................. ok
t/custom-headers-and-content.t .. ok
t/get-binary-camelia.t .......... ok
t/get-chunked-6guts.t ........... ok
t/get-perl6-org.t ............... ok
t/get-unsized.t ................. ok
t/get-w3-latin1-utf8.t .......... ok
t/get-w3-redirect.t ............. ok
t/getstore.t .................... ok
t/parse-url.t ................... ok
Failed to connect: connection timed out
in method initialize at src/gen/m-CORE.setting:24980
in method new at src/gen/m-CORE.setting:24964
in block at t/socket-sanity.t:6
t/socket-sanity.t ...............
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 2/2 subtests
t/stringify-headers.t ........... ok
t/socket-sanity.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: Bad plan. You planned 2 tests but ran 0.
Files=13, Tests=53, 80 wallclock secs ( 0.04 usr 0.02 sys + 10.79
cusr 0.76 csys = 11.61 CPU)
Result: FAIL
test stage failed for LWP::Simple: Tests failed
in method install at lib/Panda.pm:125
in block at lib/Panda.pm:1
in method resolve at lib/Panda.pm:185
in sub MAIN at
/home/tbrowde/.rakudobrew/moar-nom/install/share/perl6/site/bin/panda:20
in sub MAIN at
/home/tbrowde/.rakudobrew/moar-nom/install/share/perl6/site/bin/panda:18
in block at
/home/tbrowde/.rakudobrew/moar-nom/install/share/perl6/site/bin/panda:77
Task::Star
*test stage failed for LWP::Simple: Tests failed
t/000-load-module.t ............. ok
t/basic-auth.t .................. ok
Cannot modify an immutable value
in method dispatch:<.=> at src/gen/CORE.setting:1100
in any at src/gen/Metamodel.nqp:1461
in method parse_chunks at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:119
in method make_request at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:208
in method request_shell at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:64
in method post at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:33
in block at t/custom-headers-and-content.t:9
t/custom-headers-and-content.t ..
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
t/get-binary-camelia.t .......... ok
Cannot modify an immutable value
in method dispatch:<.=> at src/gen/CORE.setting:1100
in any at src/gen/Metamodel.nqp:1461
in method parse_chunks at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:119
in method make_request at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:208
in method request_shell at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:64
in method get at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:29
in block at t/get-chunked-6guts.t:8
t/get-chunked-6guts.t ...........
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
Cannot modify an immutable value
in method dispatch:<.=> at src/gen/CORE.setting:1100
in any at src/gen/Metamodel.nqp:1461
in method parse_chunks at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:119
in method make_request at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:208
in method request_shell at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:64
in method get at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:29
in block at t/get-perl6-org.t:15
t/get-perl6-org.t ...............
Dubious, test returned 1 (wstat 256, 0x100)
All 1 subtests passed
Cannot modify an immutable value
in method dispatch:<.=> at src/gen/CORE.setting:1100
in any at src/gen/Metamodel.nqp:1461
in method parse_chunks at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:119
in method make_request at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:208
in method request_shell at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:64
in method get at /home/coke/sandbox/star-ci/star/rakudo-star-daily/install/lib/parrot/5.3.0/languages/perl6/lib/LWP/Simple.pm:29
in block at t/get-unsized.t:8
t/get-unsized.t .................
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
t/get-w3-latin1-utf8.t .......... ok
t/get-w3-redirect.t ............. ok
t/getstore.t .................... ok
t/parse-url.t ................... ok
t/socket-sanity.t ............... ok
t/stringify-headers.t ........... ok
Test Summary Report
-------------------
t/custom-headers-and-content.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/get-chunked-6guts.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/get-perl6-org.t (Wstat: 256 Tests: 1 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
t/get-unsized.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
Files=13, Tests=52, 48 wallclock secs ( 0.06 usr 0.00 sys + 35.48 cusr 1.14 csys = 36.68 CPU)
Result: FAIL
Would be very helpful.
Using latest rakudo/panda, the tests fail:
==> Fetching LWP::Simple
==> Building LWP::Simple
==> Testing LWP::Simple
t/000-load-module.t ............. ok
# Failed test 'Hostname contains basic auth info'
# at t/basic-auth.t line 16
# expected: 'ron:[email protected]'
# got: 'www.software-path.com'
# Failed test 'Basic auth info extracted correctly: user'
# at t/basic-auth.t line 20
# expected: 'ron'
# got: (Any)
# expected: 'Camelia'
# got: (Any)
# Failed test 'Basic auth info extracted correctly: pass'
# at t/basic-auth.t line 21
# expected: 'www.software-path.com'
# got: (Any)
# Looks like you failed 4 tests of 8
t/basic-auth.t ..................
Dubious, test returned 4 (wstat 1024, 0x400)
Failed 4/8 subtests
t/custom-headers-and-content.t .. ok
t/get-binary-camelia.t .......... ok
t/get-chunked-6guts.t ........... ok
t/get-perl6-org.t ............... ok
t/get-unsized.t ................. ok
t/get-w3-latin1-utf8.t .......... ok
t/get-w3-redirect.t ............. ok
t/getstore.t .................... ok
t/parse-url.t ................... ok
t/socket-sanity.t ............... ok
t/stringify-headers.t ........... ok
Test Summary Report
-------------------
t/basic-auth.t (Wstat: 1024 Tests: 8 Failed: 4)
Failed tests: 2, 5-7
Non-zero exit status: 4
Files=13, Tests=55, 100 wallclock secs ( 0.09 usr 0.02 sys + 92.53 cusr 2.09 csys = 94.73 CPU)
Result: FAIL
test stage failed for LWP::Simple: Tests failed
In particular URL: https://cosimo:[email protected]/elio/mp3s/ used by basic-auth.t and http://jsolait.net/services/test.jsonrpc used by custom-headers-and content.t no longer answer when invoked from a web browser. I am working on a fork and if these can't be brought back up I can try to supply alternate URLs in my fork.
Thanks,
Ron
==> Testing LWP::Simple
[...]
Saw 1 occurrence of deprecated code.
================================================================================
Sub isa_ok (from Test) seen at:
t/parse-url.t, line 48
Deprecated since v2015.5, will be removed with release v2015.9!
Please use isa-ok instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Please note that *ALL* deprecated features will be removed at the RC-0 release
(expected September 2015).
This command:
perl6 -MLWP::Simple -e 'say LWP::Simple.get("https://github.com/cosimo/perl6-lwp-simple/")'
generates this error:
in method parse_chunks at /Users/gabor/rakudo-star-2015.09/install/share/perl6/lib/LWP/Simple.pm:193
in method make_request at /Users/gabor/rakudo-star-2015.09/install/share/perl6/lib/LWP/Simple.pm:222
in method request_shell at /Users/gabor/rakudo-star-2015.09/install/share/perl6/lib/LWP/Simple.pm:70
in method get at /Users/gabor/rakudo-star-2015.09/install/share/perl6/lib/LWP/Simple.pm:29
in block <unit> at check_travis.pl:20
These work fine:
perl6 -MLWP::Simple -e 'say LWP::Simple.get("https://github.com/cosimo/")'
perl6 -MLWP::Simple -e 'say LWP::Simple.get("https://github.com/")'
Mandatory URI parsing makes communication with services located under constant URL painfully slow (parsing the same URL over and over again).
To speed things up get
and post
methods should also accept URI object.
Barfs with this error when accessing GitHub Gist API. You can checkout this commit for testing:
cd /tmp; mkdir FooError; cd FooError;
git clone https://github.com/zoffixznet/perl6-Pastebin-Gist .;
git checkout d21356c4c7e4ccc0e5f22906b0468590bf2004ca;
perl6 examples/paste.pl6;
This is the output:
could not parse headers
in method parse_response at /home/zoffix/.rakudobrew/moar-nom/install/share/perl6/site/lib/LWP/Simple.pm:276
in method make_request at /home/zoffix/.rakudobrew/moar-nom/install/share/perl6/site/lib/LWP/Simple.pm:216
in method request_shell at /home/zoffix/.rakudobrew/moar-nom/install/share/perl6/site/lib/LWP/Simple.pm:71
in method post at /home/zoffix/.rakudobrew/moar-nom/install/share/perl6/site/lib/LWP/Simple.pm:34
in method paste at /var/www/tmp/perl6-Pastebin-Gist/lib/Pastebin/Gist.pm6:38
in block <unit> at examples/paste.pl6:12
After rebuilding latest rakudo
perl6 -Ilib -MLWP::Simple -e 'LWP::Simple.get("http://rakudo.org");'
hangs forever.
This is perl6 version 2015.10-171-gdf6bb2c built on MoarVM version 2015.10-51-ga362d21
on OSX
cheers
$ perl6 --version
This is Rakudo version 2017.07-126-g86cb1363d built on MoarVM version 2017.07-305-g0df98ee0
implementing Perl 6.c.
$ zef locate zef
===> From Distribution: zef:ver<0.1.26>:auth<github:ugexe>:api<>
$ zef install LWP::Simple
===> Searching for: LWP::Simple
===> Searching for missing dependencies: MIME::Base64, JSON::Tiny
===> Testing: MIME::Base64:ver('1.2'):auth('github:retupmoca')
===> Testing [OK] for MIME::Base64:ver('1.2'):auth('github:retupmoca')
===> Testing: JSON::Tiny
===> Testing [OK] for JSON::Tiny
===> Testing: LWP::Simple:ver('0.094'):auth('Cosimo Streppone')
Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at t/basic-auth.t line 39
# Failed test 'Got protected url'
# at t/basic-auth.t line 39
# Looks like you failed 1 test of 9
===> Testing [FAIL]: LWP::Simple:ver('0.094'):auth('Cosimo Streppone')
Aborting due to test failure: LWP::Simple:ver('0.094'):auth('Cosimo Streppone') (use --force-test to override)
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.12.6
BuildVersion: 16G29
Several tests abort with
Could not parse chunk header
in method parse_chunks at lib/LWP/Simple.pm:177
in method make_request at lib/LWP/Simple.pm:215
in method request_shell at lib/LWP/Simple.pm:63
in method post at lib/LWP/Simple.pm:32
in block at t/custom-headers-and-content.t:10
on Rakudo 2012.09
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.