Why 'files.py' does not print the filenames into a table format?

Benjamin Schollnick benjamin at schollnick.net
Sat Jun 15 16:29:57 EDT 2013


>> Nick, at this point, you need to hire someone to do your work for you.
> 
> The code is completely ready.
> Some detail is missing and its not printing the files as expected.

Then the code is not completely ready, it has bugs, and your trying to have the list debug and fix it for you for free.

> Irrelevant to my question i just noticed weird behavior about my pelatologio.py script which can be seen here:
> 
> http://superhost.gr/?show=stats
> 
> The first 3 files are of my doing.
> All the rest are of someone else's that managed to append entries into my counters database utilizing this code:
> 
> ================
> 
> 	try:
> 		#find the needed counter for the page URL
> 		cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
> 		data = cur.fetchone()        #URL is unique, so should only be one
> 			
> 		if not data:
> 			#first time for page; primary key is automatic, hit is defaulted
> 			cur.execute('''INSERT INTO counters (url) VALUES (%s)''', page )
> 			cID = cur.lastrowid        #get the primary key value of the new record
> ======================
> 
> Does someone want to state something?

Sure, whoever wrote that code is a fool.

http://xkcd.com/327/

<img src="http://imgs.xkcd.com/comics/exploits_of_a_mom.png">

They didn't sanitize your database inputs.

My suggestion would be for you to stop trying to re-invent the wheel, and use COTS software.  

		- Benjamin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130615/ad796b13/attachment.html>


More information about the Python-list mailing list