How to use Twill

97 views
Skip to first unread message

Alexmipego

unread,
May 28, 2010, 3:17:58 AM5/28/10
to Google App Engine
Hi,

I'm trying to run some old python code that uses Twill on GAE.
Unfortunately, it doesn't seem to work. What I did was copy paste the
code and the source files for the twill library. And then I'm getting
this error:

....\src\twill\utils.py", line 275, in run_tidy
process = subprocess.Popen(_tidy_cmd, stdin=subprocess.PIPE,
AttributeError: 'module' object has no attribute 'Popen'

I'm guessing this is trying to use some function that GAE has locked
out for some reason, but, is there a working Twill version or anyone
using it that could help me out?

Cheers

Olemis Lang

unread,
May 28, 2010, 8:44:38 AM5/28/10
to google-a...@googlegroups.com
On Fri, May 28, 2010 at 2:17 AM, Alexmipego <alexm...@gmail.com> wrote:
> Hi,
>

:o)

What are you doing exactly with twill ? If you're using in-process
intercept functionality then it might not work at GAE (I mean in the
cloud ;o), but it should work in development environment . If this is
the case I see no reason for using that feature in a production
environment .

If this is not the case , please specify what are you trying to do ;o)

--
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Control de usuarios personalizado con Apache y mod_authnz_external -
http://feedproxy.google.com/~r/simelo-es/~3/cBNqfg_xMaw/control-de-usuarios-personalizado-con.html

Alexmipego

unread,
May 28, 2010, 8:57:25 AM5/28/10
to Google App Engine
Hi,

I'm not familiar with that "intercept" feature, perhaps I'm using it
without knowing. Anyway, my test case is pretty simple:
import twill.commands
......
twill.commands.reset_browser()
b = twill.commands.get_browser()
b.go("http://www.google.com")

It fails on the .go(...) method, always. From the looks of the message
and knowing a bit about the "scraping" world, it seems like the code
is trying to call html tidy to do from "pretty-print" formatting. I'm
not too familiar with python either, but that subprocess.Popen looks a
lot like it's trying to run something external like if it was on a
bash or cmd.exe shell instead of calling a lib linked in the sources.

So, any clues?

On 28 Maio, 13:44, Olemis Lang <ole...@gmail.com> wrote:
> Control de usuarios personalizado con Apache y mod_authnz_external -http://feedproxy.google.com/~r/simelo-es/~3/cBNqfg_xMaw/control-de-us...

Alexmipego

unread,
May 28, 2010, 8:59:46 AM5/28/10
to Google App Engine
Ohh, and the error is on the devel machine, not on GAE servers.

Olemis Lang

unread,
May 28, 2010, 11:01:46 AM5/28/10
to google-a...@googlegroups.com, tip
On Fri, May 28, 2010 at 7:59 AM, Alexmipego <alexm...@gmail.com> wrote:
> Ohh, and the error is on the devel machine, not on GAE servers.
>

Ok. I suppose that the best place to ask for this should be
testing-...@lists.idyll.org

Many people familiar with that module are subscribed to that list, so
you'll probably get the right answer at the right time (that's why I'm
adding it to Cc and fixing top-posting, sorry for cross-posting , it's
a noble cause ;o) .

Please read below

What version of Python are you using ? I see no reason for such
behavior if working on your local development machine | environment ,
having the right version of Py .

AFAICR, Jess Noller (talking about another subject ;o) mentioned once
@ TiP ML something related to the possibility of compiling the
interpreter without support for given modules . That's probably what's
happening in your case (but probably not ...) .

Alexmipego

unread,
May 29, 2010, 12:59:25 PM5/29/10
to Google App Engine
I'm using 2.6 and as mentioned, the project runs fine on the same
machine if I'm using the "standalone" version (read: without GAE).

On May 28, 4:01 pm, Olemis Lang <ole...@gmail.com> wrote:
> On Fri, May 28, 2010 at 7:59 AM, Alexmipego <alexmip...@gmail.com> wrote:
> > Ohh, and the error is on the devel machine, not on GAE servers.
>
> Ok. I suppose that the best place to ask for this should be
> testing-in-pyt...@lists.idyll.org
Reply all
Reply to author
Forward
0 new messages