urllib2 does not raise exceptions if the HTTP Status Code is a 2xx one. Previously it checked only for response code 200 and 206.
Me on the net
Projects
Flickr
Flickr is currently unavailable.Pages
Developers
Archives
urllib2 does not raise exceptions if the HTTP Status Code is a 2xx one. Previously it checked only for response code 200 and 206.
Translation From PR-Speak to English of Selected Portions of Rails Developer David Heinemeier Hansson’s Response to Alex Payne’s Interview This is not about who’s right or wrong, it’s about me still laughing
This is an addition of the post Producer/Consumer in Python I wrote earlier. It’s just the same example rewritten with py.magic.greenlet. Greenlets, tasklets, micro-threads, coroutines are basically the same thing: suspending and resuming a function in multiple points is the core feature we need. In the previous example we did it with plain old generators, [...]
The list of picklable objects has a new citizen: slices. [code lang="python"] s = slice(1, 10, 2) import cPickle pickled = cPickle.dumps(s, -1) print pickled ?c__builtin__ slice qKK K?Rq. print cPickle.loads(pickled) slice(1, 10, 2) range(1, 10)[s] [2, 4, 6, 8] range(1, 10)[cPickle.loads(pickled)] [2, 4, 6, 8] [/code] There’s also a new method, chgat() in the [...]
Like Hello World in imperative programming the Producer/Consumer problem is one of kind of program everybody has wrote once in a lifetime. It’s one of the toy examples in concurrent programming demonstrating the basics of synchronization. Basically there’s a shared buffer, a producer entity and a consumer one. The producer generates some data and puts [...]
I just released another version of Pinder, my Campfire API. The major news is the ability to read the online transcripts like this: [code lang="python"] days = room.transcripts() print room.transcript(days[0]) # last transcript [{'person': u'Bob B.', 'message': u'Are you spying on me?', 'user_id': u'1234567', 'id': u'19343281'}] [/code] See Campfire.transcripts(), Room.transcripts() and Room.transcript() for the details. [...]
I decided to write this post just to get things straight and recall some memories of the past. Since I still get emails about Atom.NET I think it’s time to say it out loud and clear: I don’t care about it anymore but I still think Atom is a good idea, though I repeat: I [...]
My blog has been linked from Reddit. I definitely had an unusual peak in the logs I collected the posts about what’s new in Python-SVN in a single category. This way they can be found more easily. I’m planning on doing regular updates, once a week or so, until I’ll fed up with Python and [...]
The most relevant change since the last update is the new function socket.create_connect(). It’s an helper function easing the creation of a connected socket to a given address (the usual host+port tuple) with an optional timeout. The function is currently being used throughout some network related modules in the standard library. Its implementation is very [...]