[Tracker-discuss] [issue295] title is changed by email updates when only whitespace had changed

Ezio Melotti metatracker at psf.upfronthosting.co.za
Mon Jul 27 04:59:52 CEST 2009


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

When a new issue is created or a message is added the title could be passed to
re.sub('[\t\n\r\f\v]+', '', title). This will remove all the whitespaces except
normal spaces (I don't see any valid reason to have tabs, newlines and similar
in the title anyway).
This regex will preserve the original normal spaces (so if the user put two or
more spaces they will be saved as they are).
A simpler approach is to use re.sub('\s+', ' ', title) (or '
'.join(title.split())) to replace all the whitespaces with a single space.

----------
nosy: +ezio.melotti
status: unread -> chatting

_______________________________________________________
PSF Meta Tracker <metatracker at psf.upfronthosting.co.za>
<http://psf.upfronthosting.co.za/roundup/meta/issue295>
_______________________________________________________


More information about the Tracker-discuss mailing list