why is Python datetime.date inconsistent with the input format it allows? is this a bug in datetime.date?
Question: Why does using date(2012,08,01) & date(2012,09,01) fail but date(2012,01,01)
through date(2012,07,01) succeed?

I'm using Python v.2.6.6

here is a copy paste from my console

    
    
    In [2]: from datetime import date
    
    In [6]: date(2012,01,01)
    Out[6]: datetime.date(2012, 1, 1)
    
    In [7]: date(2012,02,01)
    Out[7]: datetime.date(2012, 2, 1)
    
    In [8]: date(2012,03,01)
    Out[8]: datetime.date(2012, 3, 1)
    
    In [9]: date(2012,04,01)
    Out[9]: datetime.date(2012, 4, 1)
    
    In [10]: date(2012,05,01)
    Out[10]: datetime.date(2012, 5, 1)
    
    In [11]: date(2012,06,01)
    Out[11]: datetime.date(2012, 6, 1)
    
    In [12]: date(2012,07,01)
    Out[12]: datetime.date(2012, 7, 1)
    

Everything up to here works then watch when I try to do the same for Aug/Sept

    
    
    In [13]: date(2012,08,01)
      File "<ipython-input-13-765ad867a574>", line 1
        date(2012,08,01)
                   ^
    SyntaxError: invalid token
    
    
    In [14]: date(2012,09,01)
      File "<ipython-input-14-f150aaea4c6c>", line 1
        date(2012,09,01)
                   ^
    SyntaxError: invalid token
    

does anyone know if this this a bug and if it's been resolved in a more
current version of python that is not python 3.0?


Answer: A number prefixed by `0` indicates an octal number in Python (before Python
3). `08` and `09` are not valid octal integers.

