Re: Issue with xml iterparse

2010-06-04 Thread bfrederi
On Jun 3, 4:13 pm, bfrederi wrote: > On Jun 3, 3:59 pm, Chris Rebert wrote: > > > > > On Thu, Jun 3, 2010 at 1:44 PM, bfrederi wrote: > > > I am using lxml iterparse and running into a very obscure error. When > > > I run iterparse on a file, it will

Re: Issue with xml iterparse

2010-06-03 Thread bfrederi
On Jun 3, 3:59 pm, Chris Rebert wrote: > On Thu, Jun 3, 2010 at 1:44 PM, bfrederi wrote: > > I am using lxml iterparse and running into a very obscure error. When > > I run iterparse on a file, it will occasionally return an element that > > has a element.text == None whe

Issue with xml iterparse

2010-06-03 Thread bfrederi
I am using lxml iterparse and running into a very obscure error. When I run iterparse on a file, it will occasionally return an element that has a element.text == None when the element clearly has text in it. I copy and pasted the problem xml into a python string, used StringIO to create a file-li

urllib2: post request to textarea

2010-04-09 Thread bfrederi
I'm getting a 500 error when attempting to make a post request with urllib2 to a form with a tag. When I create the post request with all the other post data, I don't get a 500. Just the part of the form that is a . Is this just a coincidence, and my real problem is something else? Thanks, Brando

datetime 'NoneType' sporadic error

2009-12-11 Thread bfrederi
When using the datetime module, I sporadically get " 'NoneType' object has no attribute 'datetime' " on line 40: http://dpaste.com/hold/132156/ Sorry, I don't have the traceback, this is an error that was sent to me by one of the users. It only happens occasionally. Any ideas? -- http://mail.pyt

Re: base64 Incorrect Padding

2009-07-31 Thread bfrederi
So what if I used a different encoding that isn't ASCII? Like UTF-8? Would that give me lengths that are multiples of 4 based on how the characters are represented? Or would I still need to pad with '='? -- http://mail.python.org/mailman/listinfo/python-list

Dictionary as Keyword Arguments

2008-12-11 Thread bfrederi
I was wondering if I had a dictionary of keywords and values like so: keyword_arg_dict = { 'attribute': 'stone', 'contents': 'cave people', 'path': '/path/to/cave', 'name': 'Ogg's Cave', } And I had a function that accepted keyword arguments like so: make_dwelling( attrib

Re: PIL problem

2008-10-08 Thread bfrederi
On Oct 8, 10:39 am, bfrederi <[EMAIL PROTECTED]> wrote: > On Oct 8, 10:30 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > > > On Wed, 08 Oct 2008 08:10:02 -0700, bfrederi wrote: > > > I am having a problem using PIL. I am trying to cr

Re: PIL problem

2008-10-08 Thread bfrederi
On Oct 8, 10:39 am, bfrederi <[EMAIL PROTECTED]> wrote: > On Oct 8, 10:30 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > > > On Wed, 08 Oct 2008 08:10:02 -0700, bfrederi wrote: > > > I am having a problem using PIL. I am trying to cr

Re: PIL problem

2008-10-08 Thread bfrederi
On Oct 8, 10:30 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 08 Oct 2008 08:10:02 -0700, bfrederi wrote: > > I am having a problem using PIL. I am trying to crop and image to a > > square, starting from the center of the image, but when I try

PIL problem

2008-10-08 Thread bfrederi
y1 = (height / 2) - (square_length / 2) y2 = y1 + square_length image.crop((x1,y1,x2,y2)) image.save(file_name, "JPEG") ### In my tests.py ### def testCreateSquareImage(self): """ Test to turn image into a square "&