473,403 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Client-side cookies on Python in Mac OSX

Hi, all. I'm writing an app for OS X; therefore I'd prefer to use only
the default python install that comes with Tiger. For the moment,
however, this means:

NaviOSX:~ adrianpetrescu$ python -V
Python 2.3.5

Therefore, I was not surprised to find out that cookielib did not
exist here, since I knew that it was a 2.4+ feature.

However, I *was* shocked to find out that ClientCookie, which I'd
thought was a Python 2.0+ feature, also cannot be found:
>>import ClientCookie
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named ClientCookie

Why would Apple go out of their way to remove this functionality from
their shipped version of Python? More importantly, considering I need
to programatically access a website that uses cookies for
authentication, how can I do this in OSX's Python install? Do they
provide some other library they'd prefer you to use?

I'm sure SOMEONE in the world has used cookies on Macs so I'm hoping
there is a solution for this...

Thanks in advance!
-- Adrian Petrescu

Jul 13 '07 #1
3 1668
On Jul 13, 12:14 pm, Adrian Petrescu <apetr...@uwaterloo.cawrote:
Hi, all. I'm writing an app for OS X; therefore I'd prefer to use only
the default python install that comes with Tiger. For the moment,
however, this means:

NaviOSX:~ adrianpetrescu$ python -V
Python 2.3.5

Therefore, I was not surprised to find out that cookielib did not
exist here, since I knew that it was a 2.4+ feature.

However, I *was* shocked to find out that ClientCookie, which I'd
thought was a Python 2.0+ feature, also cannot be found:
>import ClientCookie

Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named ClientCookie

Why would Apple go out of their way to remove this functionality from
their shipped version of Python? More importantly, considering I need
to programatically access a website that uses cookies for
authentication, how can I do this in OSX's Python install? Do they
provide some other library they'd prefer you to use?

I'm sure SOMEONE in the world has used cookies on Macs so I'm hoping
there is a solution for this...
They didn't remove it, it was never there in the first place.

The ClientCookie site says 'Python 2.0 or above is required'. It
doesn't say it is included with Python distributions. The package
still has to be installed separately. See:

http://wwwsearch.sourceforge.net/ClientCookie/

Graham

Jul 13 '07 #2
Oh, you're right! Silly me, I had always thought it was standard.
Thanks for pointing this out! I went and downloaded ClientCookie and
it works great on OS X. And since it is BSD-licensed, I can use it in
my app without any fear. Perfect.

Thank you, Graham!

On Jul 12, 10:28 pm, Graham Dumpleton <Graham.Dumple...@gmail.com>
wrote:
On Jul 13, 12:14 pm, Adrian Petrescu <apetr...@uwaterloo.cawrote:
Hi, all. I'm writing an app for OS X; therefore I'd prefer to use only
the default python install that comes with Tiger. For the moment,
however, this means:
NaviOSX:~ adrianpetrescu$ python -V
Python 2.3.5
Therefore, I was not surprised to find out that cookielib did not
exist here, since I knew that it was a 2.4+ feature.
However, I *was* shocked to find out that ClientCookie, which I'd
thought was a Python 2.0+ feature, also cannot be found:
>>import ClientCookie
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named ClientCookie
Why would Apple go out of their way to remove this functionality from
their shipped version of Python? More importantly, considering I need
to programatically access a website that uses cookies for
authentication, how can I do this in OSX's Python install? Do they
provide some other library they'd prefer you to use?
I'm sure SOMEONE in the world has used cookies on Macs so I'm hoping
there is a solution for this...

They didn't remove it, it was never there in the first place.

The ClientCookie site says 'Python 2.0 or above is required'. It
doesn't say it is included with Python distributions. The package
still has to be installed separately. See:

http://wwwsearch.sourceforge.net/ClientCookie/

Graham

Jul 13 '07 #3
Adrian Petrescu <ap******@uwaterloo.cawrites:
Oh, you're right! Silly me, I had always thought it was standard.
Thanks for pointing this out! I went and downloaded ClientCookie and
it works great on OS X. And since it is BSD-licensed, I can use it in
my app without any fear. Perfect.

Thank you, Graham!
The relationship is that cookielib is derived from ClientCookie:
essentially the same code, cleaned up to take advantage of newer
Python features, renamed to 'cookielib' and added to the stdlib.
The other difference is in thread synchronisation: ClientCookie had
some broken thread synchronisation at one point, which was
subsequently removed (which doesn't imply ClientCookie is not useful
in threaded code). Though an unfortunate series of events the
released cookielib ended up with that broken thread synchronisation
code. It seems at least some of those thread synchronisation bugs in
cookielib are fixed in the lastest version of Python.

http://python.org/sf/1484758

http://python.org/sf/1587139

John
Jul 14 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
2
by: Raquel | last post by:
How do I know whether the 'runtime client' and the 'application development client' are installed on my machine? When I issue the command "db2licm -l", it gives the following output: Product...
2
by: Rhino | last post by:
I am trying to verify that I correctly understand something I saw in the DB2 Information Center. I am running DB2 Personal Edition V8.2.1 on Windows. I came across the following in the Info...
0
by: Harley | last post by:
Hello, I am just learning the tcp/ip functions etc under vb.net so please look over me if this is obviouse. I have been all over looking into any functions that I didn't totaly understand and...
8
by: Ankit Aneja | last post by:
i am doing here some some socket-client work in C# windows service it is working fine for multiple clients now i want to limit these multiple clients to 25 for example i want that when service...
2
by: Delmar | last post by:
I need to build Web Application that will generate a client to execute some operations. Each client has running silent application. Maybe somebody can advice me what can I do ? Thank you.
2
by: J Huntley Palmer | last post by:
I am having a horrific time integrating uw-imap's c-client for imap support in php. The problem is a whole bunch of "Text relocation remains referenced against symbol" errors during linking....
0
by: khu84 | last post by:
Here is client server very simple code, seems to work with telnet but with with web client code gives blank output. Following is the server code:- <?php function...
2
by: nsaffary | last post by:
hi I hava a client/server program that run correctly when i run it in one computer(local) but when I run client on a one computer and run server run on another, connection does not stablish.(I set...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.