On Sun, Mar 22, 2015 at 4:36 AM, Daniel Gruno <[email protected]> wrote:

>
>
> On 2015-03-22 10:31, Greg Stein wrote:
>
>> On Sun, Mar 22, 2015 at 4:23 AM, <[email protected]> wrote:
>>
>>> ...
>>> +++ steve/trunk/pytest/www/cgi-bin/rest_admin.py Sun Mar 22 09:23:22
>>> 2015
>>>
>>> ...
>>> +                try:
>>> +                    elpath = os.path.join(homedir, "issues", election)
>>> +                    with open(elpath + "/basedata.json", "r") as f:
>>> +                        basedata = json.loads(f.read())
>>> +                        f.close()
>>> +                        if 'hash' in basedata:
>>> +                            del basedata['hash']
>>> +                        basedata['id'] = election
>>> +                        if karma >= 5 or ('owner' in basedata and
>>> basedata['owner'] == whoami):
>>> +                            output.append(basedata)
>>> +                except:
>>> +                    pass
>>>
>>>  Woah!!! ... No way. I don't know what you're trying to do with the
>> above,
>> but throwing away all exceptions is never the right answer. .... my brain
>> locks up, seeing that. I need to self-censor.
>>
>> *shudder*
>>
>> Please do something different.
>>
>
> Sorry if that came out as a 'stable' commit, it's not. I'm working on that
> specific bit right now, but I also had a disturbing phone call right in the
> middle of it, so I got a bit distrait there and just hit the commit button
> too soon. It will be fixed.
>

Thanks. I see the change you committed. Appreciated. ... that kind of code
just makes me twitch. Angry twitch :-P

I would ask that when you commit such stuff, at least put in a comment.
Something like:

  ### yes, the bare except sucks. will fix shortly.

Then I'll know to be quiet, and just wait for another commit.

Cheers,
-g

Reply via email to