Re: Re: Bug: spurious indentation error
En Sat, 29 Sep 2007 01:43:53 -0300, Mridula Ramesh <[EMAIL PROTECTED]> escribi�: > Lol, nope, I checked today too, and it happened again. Try running this > as a > script, not from the prompt - I got a SyntaxError on line 10 as expected. After correcting it, I got an `IndentationError: expected an indented block` on line 23, due to a long line being wrapped onto the next line. A syntax error may be reported some lines later than the actual mistake, if the following lines build a good construct. For example, a missing close parenthesis. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list
Re: Re: Bug: spurious indentation error
Hi. Lol, nope, I checked today too, and it happened again. Try running this as a script, not from the prompt - class main(): def __init__(self): rt.geometry("680x600") rt.config(bg="CornSilk") rt.title("my miniscule app") #MENU menu = Menu(rt) rt.config(menu=menu) # create a menu filemenu = Menu(menu), bg="White") #syntax error/ typo in this line. menu.add_cascade(label="Options", menu=filemenu) filemenu.add_command(label="Add New")#, command=callback) filemenu.add_command(label="Edit") filemenu.add_command(label="Delete") filemenu.add_separator() filemenu.add_command(label="Exit") self.dbConnect() self.nowgather(gctr) self.showfixed() self.showrecords() def dbConnect(self): #error gets thrown here as a tab-space indentation error. #connects to database D:/Catalogue.mdb, and gathers all data in a recordset #called rs. Puts this information into individual lists by field name global gmax #setting record count to zero afresh. import win32com.client conn = win32com.client.Dispatch('ADODB.Connection') DSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA SOURCE=D:/Catalogue.mdb;' conn.Open(DSN) rs = win32com.client.Dispatch('ADODB.Recordset') rs_name="MyRecordSet" rs.Cursorlocation = 3 rs.Open('SELECT * FROM Library', conn) gmax = rs.RecordCount Regards, Mridula. This is probably a bug in your mind, not in the compiler ;-) Without more detail (i.e. the complete code or a sizable and relevant chunk of it, pkus the copied error message) it's impossible to say exactly what was happening. However I am pretty confident that the 2.5.21 compiler will immediately report an unopened closing parenthesis as a syntax error. >>> something = "abc".replace("c"), "d") File "", line 1 something = "abc".replace("c"), "d") ^ SyntaxError: invalid syntax >>> So, what was the problem again? Give us a little more detail, please. regards Steve -- http://mail.python.org/mailman/listinfo/python-list
Re: Bug: spurious indentation error
Mridula Ramesh wrote: > hi. > > is this the right place to report a bug? > > i had written this by mistake: >filemenu = Menu(menu) , bg="White") > > instead of > filemenu = Menu(menu, bg="Pink") > > and the compiler kept giving me an indentation error in a line much > further down which was perfectly okay. > > i am using python 2.5.1 with IDLE 1.2.1 on a windows XP machine. > anyone else struggling with the same thing, beware! :) > > -mridula. > This is probably a bug in your mind, not in the compiler ;-) Without more detail (i.e. the complete code or a sizable and relevant chunk of it, pkus the copied error message) it's impossible to say exactly what was happening. However I am pretty confident that the 2.5.21 compiler will immediately report an unopened closing parenthesis as a syntax error. >>> something = "abc".replace("c"), "d") File "", line 1 something = "abc".replace("c"), "d") ^ SyntaxError: invalid syntax >>> So, what was the problem again? Give us a little more detail, please. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://del.icio.us/steve.holden Sorry, the dog ate my .sigline -- http://mail.python.org/mailman/listinfo/python-list
Bug: spurious indentation error
hi. is this the right place to report a bug? i had written this by mistake: filemenu = Menu(menu) , bg="White") instead of filemenu = Menu(menu, bg="Pink") and the compiler kept giving me an indentation error in a line much further down which was perfectly okay. i am using python 2.5.1 with IDLE 1.2.1 on a windows XP machine. anyone else struggling with the same thing, beware! :) -mridula. -- http://mail.python.org/mailman/listinfo/python-list