开发者

Different work of the script in Windows and in FreeBSD

I'm writing some script, that works with web-servers.

So, I have the following code:

client = suds.client.Client(WSDLfile)
client.service.Login('mylogin', 'mypass')
print client.options.transport.cookiejar
#######
sessnum = str(client.options.transport.cookiejar).split(' ')[1]
client = suds.client.Client( WSDLfile, headers= { 'Set-Cookie' : sessnum } )

When开发者_如何学编程 running in FreeBSD, it returns

<cookielib.CookieJar[<Cookie sessnum=9WAXQ25D37XY535F6SZ3GXKSCTZG8CVJ for .IP.IP.IP.IP/>]>

but in Windows it returns

<cookielib.CookieJar[]>

How can I fix it?


AFAIK client.options.transport.cookiejar is an iterable so what happens on each system when you have:

for c in client.options.transport.cookiejar:
    print client.options.transport.cookiejar

Failing that, what if in your Windows system you don't have cookies allowed? That may stop the session from being saved.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜