[issue15973] Segmentation fault on timezone comparison

2012-09-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ec77f8fb9958 by Georg Brandl in branch 'default':
Closes #15973: fix a segmentation fault when comparing timezone objects.
http://hg.python.org/cpython/rev/ec77f8fb9958

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-22 Thread Georg Brandl

Georg Brandl added the comment:

Which commit(s) do I have to pick?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-22 Thread Stefan Krah

Stefan Krah added the comment:

This one: 63cb0a642c84

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-22 Thread Georg Brandl

Georg Brandl added the comment:

Done as ec77f8fb9958.

--
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-20 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

Alexander, did you send a contributor agreement?. I don't see it in the tracker 
:-??

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-20 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

 Alexander, did you send a contributor agreement?

At least twice. :-)

--
keywords: +patch
priority: normal - high
stage: needs patch - commit review
Added file: http://bugs.python.org/file27234/issue15973.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-20 Thread Stefan Krah

Stefan Krah added the comment:

Looks good. It would be nice to have this in 3.3.0. There are a couple
of blockers open, so perhaps this could go in, too.

Georg, are we going to have an rc3 anyway?

--
nosy: +georg.brandl

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9fba12ceb2fd by Alexander Belopolsky in branch '3.2':
Issue #15973: Fixed segmentation fault on timezone comparison to other types.
http://hg.python.org/cpython/rev/9fba12ceb2fd

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-20 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Leeaving the issue open in case it will go to 3.3.0.  Reassigning to the RM.

--
assignee: belopolsky - georg.brandl
resolution:  - fixed
stage: commit review - committed/rejected

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-20 Thread STINNER Victor

STINNER Victor added the comment:

Your change does not compile on Windows:

_datetimemodule.c
..\Modules\_datetimemodule.c(3247) : error C2065: 'Py_RETURN_NOTIMPLEMENTED' : 
undeclared identifier

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.2/builds/194/steps/compile/logs/stdio

--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f17f67f0ec4b by Alexander Belopolsky in branch '3.2':
Issue #15973: fixed 3.2 backport.
http://hg.python.org/cpython/rev/f17f67f0ec4b

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread Lance Helsten

New submission from Lance Helsten:

In the 3.2.3 interpreter execute the following line:
`None == datetime.timezone(datetime.timedelta())`
The interpreter will crash with a `Segmentation fault: 11`.

--
assignee: ronaldoussoren
components: Macintosh
files: CoreDump.txt
messages: 170732
nosy: lanhel, ronaldoussoren
priority: normal
severity: normal
status: open
title: Segmentation fault on timezone comparison
type: crash
versions: Python 3.2
Added file: http://bugs.python.org/file27224/CoreDump.txt

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread Stefan Krah

Stefan Krah added the comment:

Reproducible also on Linux with Python 3.3.

--
components: +Extension Modules -Macintosh
nosy: +belopolsky, skrah
stage:  - needs patch
versions: +Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread Alexander Belopolsky

Changes by Alexander Belopolsky alexander.belopol...@gmail.com:


--
assignee: ronaldoussoren - belopolsky

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread John Taylor

John Taylor added the comment:

Crashes Python 3.2.3 and Python 3.3.0rc2 on Windows 7 as well.

--
nosy: +jftuga

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I cannot reproduce on a Mac with py3k tip.

Python 3.3.0rc2+ (default:19c74cadea95, Sep 19 2012, 14:39:07) 
[GCC 4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.61)] on darwin
Type help, copyright, credits or license for more information.
 import datetime
 None == datetime.timezone(datetime.timedelta())
False

Can anyone reproduce in a debug build and post a stack trace?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread Stefan Krah

Stefan Krah added the comment:

The segfault does not occur in a debug build. The stack trace
suggests that timezone_richcompare() accesses other-offset
of the None object:

(gdb) f 2
#2  0x0041d4e9 in do_richcompare (v=None, w=datetime.timezone at 
remote 0x76688ab0, 
op=value optimized out) at Objects/object.c:563
563 res = (*f)(w, v, _Py_SwappedOp[op]);
(gdb) f 1
#1  timezone_richcompare (self=0x76688ab0, other=value optimized out, 
op=2)
at /home/stefan/pydev/cpython-commit/Modules/_datetimemodule.c:3218
3218return delta_richcompare(self-offset, other-offset, op);
(gdb) l
3213timezone_richcompare(PyDateTime_TimeZone *self,
3214 PyDateTime_TimeZone *other, int op)
3215{
3216if (op != Py_EQ  op != Py_NE)
3217Py_RETURN_NOTIMPLEMENTED;
3218return delta_richcompare(self-offset, other-offset, op);
3219}
3220
3221static Py_hash_t
3222timezone_hash(PyDateTime_TimeZone *self)
(gdb) f 0
#0  0x75d850cf in delta_richcompare (self=0x76688ab0, other=value 
optimized out, op=2)
at /home/stefan/pydev/cpython-commit/Modules/_datetimemodule.c:1823
1823if (PyDelta_Check(other)) {

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread R. David Murray

R. David Murray added the comment:

On linux it segfaults for me in the debug interpreter.  On default tip.

--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I think the following simple patch should do the trick.  I'll add some tests 
and commit.  Should this get in 3.3.0? 


diff -r 19c74cadea95 Modules/_datetimemodule.c
--- a/Modules/_datetimemodule.c Wed Sep 19 08:25:01 2012 +0300
+++ b/Modules/_datetimemodule.c Wed Sep 19 21:42:51 2012 -0400
@@ -3215,6 +3215,11 @@
 {
 if (op != Py_EQ  op != Py_NE)
 Py_RETURN_NOTIMPLEMENTED;
+if (Py_TYPE(other) != PyDateTime_TimeZoneType)
+   if (op == Py_EQ)
+   Py_RETURN_FALSE;
+   else
+   Py_RETURN_TRUE;
 return delta_richcompare(self-offset, other-offset, op);
 }

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Hopefully, there will be some more braces, though. :)

--
nosy: +benjamin.peterson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

What about datetime subclasses?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

 What about datetime subclasses?

Do you mean timezone subclasses?  Timezone type is not subclassable, but we 
should probably support comparison with any tzinfo subclass.  I'll add this 
logic, but arguably that would be a new feature.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com