BackupGGCode / roster-dns-management

DNS Management system.
0 stars 2 forks source link

Possible problems with lstrip(), rstrip(), and strip() #378

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
During testing, Seth unearthed an interesting fact about the Python functions 
lstrip, rstrip, and strip. They do not work as the Roster developers may have 
intended. I know that I have written code with *strip in the past that assumes 
they work a way they do not.

Example:
>>> 'purdue.edu'.rstrip('.edu')
'pur'

Seth and I (and possibly others) were always under the impression that this 
command would return 'purdue' 

*strip is used all over Roster. Many of these uses may be incorrect, and thus 
may produce bugs.

The documentation on *strip can be viewed here:
http://docs.python.org/2/library/stdtypes.html

We need to grep through Roster and make sure that *strip usage is correct in 
all cases.

Original issue reported on code.google.com by J.S.Pavlick@gmail.com on 19 Jul 2013 at 6:18

GoogleCodeExporter commented 9 years ago

Original comment by J.S.Pavlick@gmail.com on 16 Aug 2013 at 3:41