Unable to edit blogger posts where post time has been modified

Bug #483675 reported by Graham White
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
BloGTK
Fix Committed
Undecided
JayReding

Bug Description

Using BloGTK development version (trunk checked out at approximately 4pm GMT on Monday Nov 16th)...

I have some previous posts I'm unable to edit on my blog, these are posts where I have manually specified the publication time. This is done in blogger for one reason or another, but most commonly for scheduled posting where you can write a post in advance and have it published at a given time in the future.

In these instances I've noticed the downloaded cache contains entries such as:
                                <issued>20090326T11:</issued>
                                <modified>20090326T11:</modified>
                                <created>20090326T11:</created>

This leads to the following trace in BloGTK:

Traceback (most recent call last):
  File "./bin/../share/blogtk2/lib/blogtk2/main.py", line 440, in createPreview
    post_datestamp = time.strptime(entry.find('issued').text, '%Y%m%dT%H:%M:%S')
  File "/usr/lib/python2.6/_strptime.py", line 454, in _strptime_time
    return _strptime(data_string, format)[0]
  File "/usr/lib/python2.6/_strptime.py", line 325, in _strptime
    (data_string, format))
ValueError: time data '20090326T11:' does not match format '%Y%m%dT%H:%M:%S'

I can confirm that if I manually hack the cache entries to each read 20090326T11:00:00 then all works as expected.

Related branches

Revision history for this message
Graham White (graham-alton) wrote :

I should have mentioned this is a blogger blog.

Investigating further I can see the expected returned timestamp would look like:
  2009-07-22T21:08:00.001+01:00

In the cases where BloGTK is failing the returned timestamp looks like:
  2009-03-26T11:41:00.001Z

So one way to fix appears to be to change line 58 in bloggeratom.py from
  postdate = entry.published.text[:-10].replace('-', '')
to
  postdate = entry.published.text[:19].replace('-', '')

i.e. instead of chopping of the bits you don't want from the end of the string, just keep the bits you do want from the beginning.

Revision history for this message
Graham White (graham-alton) wrote :

Argh, the same bug appears to exist on line 252 of editor.py too. Now I can read/cache entries from the blog and edit previous posts too. :-)

JayReding (jayreding)
Changed in blogtk:
assignee: nobody → JayReding (jayreding)
JayReding (jayreding)
Changed in blogtk:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.