Issue with MediaWiki bot upload function

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue with MediaWiki bot upload function

Roman Noverlan
Hi all.

I use Perl and upload functions of MediaWiki::API and MediaWiki::Bot modules
(last version).

Bots don't work - returned "HTTP::Message content must be bytes at
/usr/local/share/perl/5.10.0/HTTP/Request/Common.pm line 91".

OS is Debian Linux.

How to resolve this issue?

--
Roman Noverlan
_______________________________________________
Wikibots-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikibots-l
Reply | Threaded
Open this post in threaded view
|

Re: Issue with MediaWiki bot upload function

Federico Leva (Nemo)
Roman Noverlan, 08/10/2011 02:16:
> I use Perl and upload functions of MediaWiki::API and MediaWiki::Bot modules
> (last version).

Just to check: you know there's
https://meta.wikimedia.org/wiki/Pywikipediabot/upload.py , don't you?

Nemo

_______________________________________________
Wikibots-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikibots-l
Reply | Threaded
Open this post in threaded view
|

Re: Issue with MediaWiki bot upload function

Platonides
In reply to this post by Roman Noverlan
Roman Noverlan wrote:

> Hi all.
>
> I use Perl and upload functions of MediaWiki::API and MediaWiki::Bot modules
> (last version).
>
> Bots don't work - returned "HTTP::Message content must be bytes at
> /usr/local/share/perl/5.10.0/HTTP/Request/Common.pm line 91".
>
> OS is Debian Linux.
>
> How to resolve this issue?
>
> --
> Roman Noverlan

Can you provide the http sent and the answer from the server?
Tipically I would capture it using wireshark, then copy the contents,
remove any sensitive data (eg. replace the content of session cookies)
and strip the actual file content if it is too big.
Note that just looking at the server response may point you to the
problem better than the high-level error.

_______________________________________________
Wikibots-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikibots-l
Reply | Threaded
Open this post in threaded view
|

Re: Issue with MediaWiki bot upload function

Roman Noverlan
In reply to this post by Federico Leva (Nemo)
Yes, you suggest call this script from Perl? In my perl script for mediawiki
works all components but not upload

2011/10/8 Federico Leva (Nemo) <[hidden email]>

> Roman Noverlan, 08/10/2011 02:16:
> > I use Perl and upload functions of MediaWiki::API and MediaWiki::Bot
> modules
> > (last version).
>
> Just to check: you know there's
> https://meta.wikimedia.org/wiki/Pywikipediabot/upload.py , don't you?
>
> Nemo
>
> _______________________________________________
> Wikibots-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikibots-l
>
_______________________________________________
Wikibots-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikibots-l
Reply | Threaded
Open this post in threaded view
|

Re: Issue with MediaWiki bot upload function

Federico Leva (Nemo)
Roman Noverlan, 09/10/2011 14:37:
> Yes, you suggest call this script from Perl? In my perl script for mediawiki
> works all components but not upload

I'm not able to suggest anything, listen to Platodines for suggestions. :-)
I was just checking that you were not reinventing the wheel for some
simple task, but if it's not very simple I can't help. ;-)

Nemo

_______________________________________________
Wikibots-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikibots-l
Reply | Threaded
Open this post in threaded view
|

Re: Issue with MediaWiki bot upload function

Roman Noverlan
In reply to this post by Roman Noverlan
Example of code, don't work: http://dpaste.com/hold/632543/
_______________________________________________
Wikibots-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikibots-l
Reply | Threaded
Open this post in threaded view
|

Re: Issue with MediaWiki bot upload function

Platonides
Roman Noverlan wrote:
> Example of code, don't work: http://dpaste.com/hold/632543/

Reading
http://search.cpan.org/~gaas/libwww-perl-6.03/lib/LWP/UserAgent.pm it
seems that $ua->get returns a response object,
while "HTTP::Message content must be bytes at
/usr/local/share/perl/5.10.0/HTTP/Request/Common.pm line 91". seems to
hint that
the $response passed to $api->edit isn't the contents.
(perhaps $response->is_success() is false?)

_______________________________________________
Wikibots-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikibots-l
Reply | Threaded
Open this post in threaded view
|

Re: Issue with MediaWiki bot upload function

Mark Wagner-2
In reply to this post by Roman Noverlan
On Fri, Oct 14, 2011 at 18:53, Roman Noverlan <[hidden email]> wrote:
> Example of code, don't work: http://dpaste.com/hold/632543/

First, you probably want "$response->decoded_content()", and second,
you want to make sure that $response is a scalar rather than a
reference or undef.

--
Mark

_______________________________________________
Wikibots-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikibots-l