[Python-bugs-list] [ python-Bugs-558072 ] faqwiz.py could do email obfuscation

noreply@sourceforge.net noreply@sourceforge.net
Fri, 09 Aug 2002 07:50:43 -0700


Bugs item #558072, was opened at 2002-05-19 16:50
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=558072&group_id=5470

Category: Demos and Tools
Group: Feature Request
Status: Open
Resolution: None
>Priority: 3
Submitted By: Christian Reis (kiko_async)
Assigned to: Guido van Rossum (gvanrossum)
Summary: faqwiz.py could do email obfuscation

Initial Comment:
Faqwiz.py could obfuscate emails very easily, simply by
replacing @ by some other symbol in it's output. I've
homecooked a solution that basically involves:

adding to faqconf.py:

 # Obfuscate @ symbol as

 OBFUSCATE="-at-"

and changing interpolate() in faqwiz.py:

 def _interpolate(format, args, kw):
    try:
        quote = kw['_quote']
    except KeyError:
        quote = 1 
    d = (kw,) + args + (faqconf.__dict__,)
    m = MagicDict(d, quote)
    return string.replace(format % m, '@', OBFUSCATE)

This isn't my favourite solution, though, but since I
find the code a bit hard to follow, it suffices for
now. I'm willing to work a bit more on this if it
interests people.

----------------------------------------------------------------------

Comment By: Christian Reis (kiko_async)
Date: 2002-06-13 07:22

Message:
Logged In: YES 
user_id=222305

You're right, I did. The patch attached does it in a less
broken way, though I don't like the way I have to
permanently change last_changed_email - I just wanted to
obfuscate on the printing.

Anyway, since the link can't be a mailto anymore (which may
be considered a regression) I've removed the relevant link
from faqconf.py.

I've kept the faqconf.py OBFUSCATE symbol but am unsure as
to where it should go.

I've also rolled in two changes I did locally to my faqwiz.
The first one is a simple CSS mod that avoids the need for
an external image and makes the PRE sections highlight.

The second one is adding LABEL to the radiobuttons on the
front page and removing the "/"s and <BR> between the first
"query argument" options. It was confusing users at the
office. The LABEL tag allows you to click on the label and
have the radiobutton select, and is supported on superior
browsers (cough mozilla cough).

I'd appreciate comments, thanks.

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-06-10 16:45

Message:
Logged In: YES 
user_id=6380

Clearly this does too much -- interpolate is used in a
number of contexts where a @ shouldn't be obfuscated, e.g.
commands to be executed by the shell.

I'm unclear on *where* you'd like to obfuscate email
addresses. Do you only want to obfuscate the email address
of the person who modified the entry, or do you want to
obfuscate all @ signs anywhere in the text? The latter seems
overkill, and can cause breakage in code samples that happen
to use @ signs.

BTW, you're right that this code is hard to follow! It could
benefit from a few comments here or there... :-(

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-06-05 14:46

Message:
Logged In: YES 
user_id=6380

Good idea.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=558072&group_id=5470