[Python-Dev] More on Py3K urllib -- urlencode()

Dan Mahn dan.mahn at digidescorp.com
Tue Mar 10 04:18:22 CET 2009


Yes, that was a good idea.  I found some problems, and attached a new 
version.  It looks more complicated than I wanted, but it is a very 
regular repetition, so I hope it is generally readable.

I used "doctest" to include the test scenarios.  I was not familiar with 
it before, but it seems to work quite well.  The main snag I hit was 
that I had to jazz around with the escape sequences (backslashes) in 
order to get the doc string to go in properly.  That is, the lines in 
the string are not the lines I typed at the command prompt, as Python is 
interpreting the escapes in the strings when the file is imported.

In an effort to make fewer tests, the lines of the test strings grew 
pretty long.  I'm not sure if I should try to cut the lengths down or not.

Any suggestions would be welcome before I try to submit this as a patch.

- Dan


Bill Janssen wrote:
> Aahz <aahz at pythoncraft.com> wrote:
>
>   
>> On Sat, Mar 07, 2009, Dan Mahn wrote:
>>     
>>> After a harder look, I concluded there was a bit more work to be done,  
>>> but still very basic modifications.
>>>
>>> Attached is a version of urlencode() which seems to make the most sense  
>>> to me.
>>>
>>> I wonder how I could officially propose at least some of these  
>>> modifications.
>>>       
>> Submit a patch to bugs.python.org
>>     
>
> And it would help if it included a lot of test cases.
>
> Bill
>   
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: new_urlencode.py
URL: <http://mail.python.org/pipermail/python-dev/attachments/20090309/7e746b0b/attachment.txt>


More information about the Python-Dev mailing list