[issue16765] Superfluous import in cgi module

2012-12-24 Thread Michiel Holtkamp

New submission from Michiel Holtkamp:

The standard module cgi.py from Python 2.x imports urllib, but urllib is not 
used. This causes a little bit of extra memory usage and a small increase in 
load time. It's not much, but it was enough for me to notice when I was 
profiling my program.

I think the urllib import can be safely removed in 2.6 and 2.7. I've tested 
without the import and it works as expected in my case.

In Python 3.2 (other 3.x versions not checked), urllib.parse is imported but 
here it is actually used, so no problem there.

PS. first time submitting a bug here, so if I'm doing something wrong, please 
be gentle :)

--
components: Library (Lib)
messages: 178055
nosy: mjholtkamp
priority: normal
severity: normal
status: open
title: Superfluous import in cgi module
type: performance
versions: Python 2.6, Python 2.7

___
Python tracker 
<http://bugs.python.org/issue16765>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16765] Superfluous import in cgi module

2012-12-24 Thread Michiel Holtkamp

Michiel Holtkamp added the comment:

Fair enough, I think I'm using 2.7 only. I wasn't sure about the patch format, 
so I added a unified diff. If you require a different format, please let me 
know.

--
keywords: +patch
Added file: http://bugs.python.org/file28420/patch-python2.7-cgi.py.diff

___
Python tracker 
<http://bugs.python.org/issue16765>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16765] Superfluous import in cgi module

2012-12-25 Thread Michiel Holtkamp

Michiel Holtkamp added the comment:

Thanks, I will do that next time. Happy holidays everyone!

--

___
Python tracker 
<http://bugs.python.org/issue16765>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com