[issue13204] sys.flags.__new__ crashes

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks for the patch, Jessica. It seems to work under Windows here.

--
versions: +Python 3.4

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



[issue13204] sys.flags.__new__ crashes

2014-04-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7052fdd90a11 by Antoine Pitrou in branch '3.4':
Issue #13204: Calling sys.flags.__new__ would crash the interpreter, now it 
raises a TypeError.
http://hg.python.org/cpython/rev/7052fdd90a11

New changeset a14012352f65 by Antoine Pitrou in branch 'default':
Issue #13204: Calling sys.flags.__new__ would crash the interpreter, now it 
raises a TypeError.
http://hg.python.org/cpython/rev/a14012352f65

--
nosy: +python-dev

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



[issue13204] sys.flags.__new__ crashes

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I've committed the patch to 3.4 and 3.5. I'm closing the issue, I don't think 
fixing 2.7 is important at this point.

--
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue13204] sys.flags.__new__ crashes

2014-04-27 Thread Jessica McKellar

Jessica McKellar added the comment:

Thanks for reporting this and providing a patch, Trundle.

The Python 3 patch didn't apply cleanly anymore, so I regenerated it and added 
tests for sys.version_info and sys.getwindowsversion.

* The patch passes `make patchcheck`
* The full test suite passes with this patch.
* Testing manually, without this patch each of the following segfaults, and 
with the patch they raise errors instead:

import sys; sys.flags.__new__(type(sys.flags))
import sys; sys.version_info.__new__(type(sys.version_info))
import sys; sys.getwindowsversion().__new__(type(sys.getwindowsversion()))

One important caveat is that while I confirmed the sys.getwindowsversion 
segfault on Windows, I don't have Visual Studio set up so I couldn't build and 
test the new test for sys.getwindowsversion (I ran the full test suite on OSX, 
where this test is skipped).

--
keywords: +needs review
nosy: +jesstess
versions: +Python 3.5 -Python 3.2, Python 3.3
Added file: http://bugs.python.org/file35068/issue13204.patch

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



[issue13204] sys.flags.__new__ crashes

2011-11-13 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Thanks for the patch. You should add the same tests for sys.version_info and 
sys.getwindowsversion.

--
nosy: +pitrou
stage:  - patch review

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



[issue13204] sys.flags.__new__ crashes

2011-11-12 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

You are right.  Even if it’s an undocumented internal type, there is no reason 
not to fix it.  There are plenty of similar crash fixes committed in the repo.

--

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



[issue13204] sys.flags.__new__ crashes

2011-11-05 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

I’m not sure it is useful to fix this bug.

--
nosy: +eric.araujo

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



[issue13204] sys.flags.__new__ crashes

2011-11-05 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Why not?

--
nosy: +ezio.melotti

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



[issue13204] sys.flags.__new__ crashes

2011-11-05 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Because the class of sys.flags is an implementation detail.  Most people won’t 
try to instantiate it, IMO.

--

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



[issue13204] sys.flags.__new__ crashes

2011-11-05 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

That's probably true, but IMHO it's not a valid reason to keep the buggy 
behavior.

--

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



[issue13204] sys.flags.__new__ crashes

2011-11-05 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Why would we want to prevent users from creating new instances of FlagsType?

--
nosy: +amaury.forgeotdarc

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



[issue13204] sys.flags.__new__ crashes

2011-10-17 Thread Andreas Stührk

New submission from Andreas Stührk andy-pyt...@hammerhartes.de:

It's not possible (by intention) to instantiate a new instance of sys.flags. 
This is achieved by setting the tp_new slot to NULL (in `_PySys_Init()`), 
after `PyType_Ready()` is called, which means that a slot wrapper is added to 
the type dict for the tp_new slot (because the slot != NULL at that time). 
The problem is now that if one calls `sys.flags.__new__` directly, a null 
pointer dereference occurs in `tp_new_wrapper()`.

Attached is a patch that fixes the crash and adds a test.

--
files: sys_flags__new__crash.patch
keywords: patch
messages: 145763
nosy: Trundle
priority: normal
severity: normal
status: open
title: sys.flags.__new__ crashes
type: crash
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file23431/sys_flags__new__crash.patch

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



[issue13204] sys.flags.__new__ crashes

2011-10-17 Thread Andreas Stührk

Changes by Andreas Stührk andy-pyt...@hammerhartes.de:


Added file: http://bugs.python.org/file23432/sys_flags__new__crash_2.7.patch

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



[issue13204] sys.flags.__new__ crashes

2011-10-17 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
nosy: +haypo

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