[issue1257] atexit errors should result in nonzero exit code

2007-10-10 Thread Lakin Wecker

Lakin Wecker added the comment:

I am an agreeance with the original report.  I just finished writing an
automated test that did the following to work around this behavior:

46  # Sometimes an exception happens during exit, try to 
make
sure we get   
47  # a non_zero exit code. 
48  old_exitfunc = sys.exitfunc 
49  def exitfunc(): 
50  try: 
51  old_exitfunc() 
52  except SystemExit: 
53  raise 
54  except: 
55  raise SystemExit(1)

--
nosy: +lakin.wecker

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1257>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1257] atexit errors should result in nonzero exit code

2007-10-10 Thread Lakin Wecker

Lakin Wecker added the comment:

sorry for the noise and duplication.  The full code listing should have
been:

46  # Sometimes an exception happens during exit, try to 
make
sure we get   
47  # a non_zero exit code. 
48  old_exitfunc = sys.exitfunc 
49  def exitfunc(): 
50  try: 
51  old_exitfunc() 
52  except SystemExit: 
53  raise 
54  except: 
55  raise SystemExit(1) 
56  sys.exitfunc = exitfunc

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1257>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13936] datetime.time(0, 0, 0) evaluates to False despite being a valid time

2012-02-03 Thread Lakin Wecker

New submission from Lakin Wecker :

midnight is represented by datetime.time(0,0,0).  However, this time (unlike 
all other valid times, including datetime.time(0,0,1)) evalutes to false in if 
conditions:

import datetime
if datetime.time(0,0,0):
print "datetime.time(0,0,0) is not a bug!"
else:
print "datetime.time(0,0,0) is a bug!"

if datetime.time(0,0,1):
print "datetime.time(0,0,1) is not a bug!"
else:
print "datetime.time(0,0,1) is a bug!"

--
messages: 152556
nosy: Lakin.Wecker
priority: normal
severity: normal
status: open
title: datetime.time(0,0,0) evaluates to False despite being a valid time

___
Python tracker 
<http://bugs.python.org/issue13936>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13936] datetime.time(0, 0, 0) evaluates to False despite being a valid time

2012-02-03 Thread Lakin Wecker

Lakin Wecker  added the comment:

I'm updating the versions to the ones that I've actually tried it on - this is 
not an exhaustive search at this point.

--
versions: +Python 2.6, Python 2.7

___
Python tracker 
<http://bugs.python.org/issue13936>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13936] datetime.time(0, 0, 0) evaluates to False despite being a valid time

2012-02-03 Thread Lakin Wecker

Changes by Lakin Wecker :


--
components: +Library (Lib)
type:  -> behavior

___
Python tracker 
<http://bugs.python.org/issue13936>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13936] datetime.time(0, 0, 0) evaluates to False despite being a valid time

2012-02-03 Thread Lakin Wecker

Lakin Wecker  added the comment:

Right. I've updated my code to be more correct:

instead of:

if not start_time:
start_time = default_time

it now reads:

if start_time is None:
start_time = default_time

which operates correctly and works fine for my case, I just thought it was odd 
that one time out of all of them evaluates to False.  I too wonder if it's by 
design or not.

It's definitely not documented if it is by design.

--

___
Python tracker 
<http://bugs.python.org/issue13936>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13936] datetime.time(0, 0, 0) evaluates to False despite being a valid time

2012-02-03 Thread Lakin Wecker

Lakin Wecker  added the comment:

Although I find it odd, you are all correct.

It is documented.  (I don't know how I missed that when I read those docs 
looking for that exact documentation).

It is consistent with the rest of python.

Do I close this? Do you guys? I'm fine with closing it.  Thanks and sorry for 
the noise.

--

___
Python tracker 
<http://bugs.python.org/issue13936>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13936] datetime.time(0, 0, 0) evaluates to False despite being a valid time

2012-02-03 Thread Lakin Wecker

Lakin Wecker  added the comment:

Yeah - good point, and I agree.

--

___
Python tracker 
<http://bugs.python.org/issue13936>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com