Commit Graph

105 Commits

Author SHA1 Message Date
Larry Hastings 402b73fb8d Backported PyCapsule from 3.1, and converted most uses of
CObject to PyCapsule.
2010-03-25 00:54:54 +00:00
Victor Stinner 53ff86ea5f Fix _curses.tiget*() functions: deny None to avoid a crash.
Fix the following calls: _curses.tigetflag(None), _curses.tigetnum(None),
_curses.tigetstr(None).
2010-03-25 00:51:58 +00:00
Ezio Melotti eb6d430041 Silence compiler warnings. 2010-03-13 04:39:51 +00:00
Benjamin Peterson 41162ebdad remove CVS id 2010-03-01 23:25:13 +00:00
Andrew M. Kuchling 72aae73d47 Fix comment typo 2010-02-22 18:38:23 +00:00
Andrew M. Kuchling 38c123651c #7597: curses.use_env() can be called before initscr(). Noted by Kan-Ru Chen 2010-02-22 16:26:47 +00:00
Andrew M. Kuchling b49e53ee16 #6243: fix segfault when keyname() returns a NULL pointer.
Bug noted by Trundle, patched by Trundle and Jerry Chen.
2009-09-25 22:23:54 +00:00
Alexandre Vassalotti 6d78736177 Initialize variables in PyCurses_getsyx() to avoid compiler warnings. 2009-07-17 07:54:23 +00:00
Andrew M. Kuchling 3d8f8c1d62 Only include update_lines_cols() function when it's actually going to be used 2008-06-19 14:02:30 +00:00
Gregory P. Smith dd96db63f6 This reverts r63675 based on the discussion in this thread:
http://mail.python.org/pipermail/python-dev/2008-June/079988.html

Python 2.6 should stick with PyString_* in its codebase.  The PyBytes_* names
in the spirit of 3.0 are available via a #define only.  See the email thread.
2008-06-09 04:58:54 +00:00
Christian Heimes 593daf545b Renamed PyString to PyBytes 2008-05-26 12:51:38 +00:00
Georg Brandl 29604a1b4c #1940: make it possible to use curses.filter() before curses.initscr()
as the documentation says.
2008-01-26 14:03:47 +00:00
Andrew M. Kuchling 3eb4aa733a Related to patch #1114: fix another place where attr_t is assumed to be a long 2008-01-09 12:27:41 +00:00
Andrew M. Kuchling 62182c8b72 Patch 1114: fix compilation of curses module on 64-bit AIX, and any other LP64 platforms where attr_t isn't a C long 2008-01-08 14:56:02 +00:00
Christian Heimes 000a074c95 Modified PyImport_Import and PyImport_ImportModule to always use absolute imports by calling __import__ with an explicit level of 0
Added a new API function PyImport_ImportModuleNoBlock. It solves the problem with dead locks when mixing threads and imports
2008-01-03 22:16:32 +00:00
Christian Heimes e93237dfcc #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT. Macros for b/w compatibility are available. 2007-12-19 02:37:44 +00:00
Martin v. Löwis 6819210b9e PEP 3123: Provide forward compatibility with Python 3.0, while keeping
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
2007-07-21 06:55:02 +00:00
Neal Norwitz a84dcd7546 Stop using METH_OLDARGS implicitly 2007-05-22 07:16:44 +00:00
Andrew M. Kuchling a6fbc1eabb Point readers at the patch submission instructions 2007-04-11 13:42:25 +00:00
Andrew M. Kuchling 400a49ba79 Add window.chgat() method, submitted via e-mail by Fabian Kreutz 2007-04-11 13:39:00 +00:00
Walter Dörwald d391f0855c Patch for bug #1633621: if curses.resizeterm() or
curses.resize_term() is called, update _curses.LINES,
_curses.COLS, curses.LINES and curses.COLS.
2007-03-06 20:38:57 +00:00
Neal Norwitz 6aefa916a9 Bug #1548092: fix curses.tparm seg fault on invalid input. Needs backport to 2.5.1 and earlier. 2006-09-02 02:50:35 +00:00
Neal Norwitz 20745b1a70 Handle failure from PyModule_GetDict() (Klocwork 208).
Fix a bunch of refleaks in the init of the module.  This would only be found
when running python -v.
2006-08-13 18:12:45 +00:00
Andrew M. Kuchling a1da20472f Correct error message 2006-07-26 17:18:01 +00:00
Andrew M. Kuchling 55b0a0eb0d [Bug #1471938] Fix build problem on Solaris 8 by conditionalizing the use of mvwgetnstr(); it was conditionalized a few lines below. Fix from Paul Eggert. I also tried out the STRICT_SYSV_CURSES case and am therefore removing the 'untested' comment. 2006-07-26 17:16:52 +00:00
Walter Dörwald 4994d9546c Patch #1506645: add Python wrappers for the curses functions
is_term_resized, resize_term and resizeterm. This uses three
separate configure checks (one for each function).
2006-06-19 08:07:50 +00:00
Martin v. Löwis 15e62742fa Revert backwards-incompatible const changes. 2006-02-27 16:46:16 +00:00
Neal Norwitz 1ac754fa10 Check return result from Py_InitModule*(). This API can fail.
Probably should be backported.
2006-01-19 06:09:39 +00:00
Neal Norwitz 88bbd73d07 SF bug #1400822, Extended version of _curses over{lay,write} does not work
Fix signatures to conform to doc (also fixed ungetmouse()).

Will backport.
2006-01-10 07:05:44 +00:00
Jeremy Hylton af68c874a6 Add const to several API functions that take char *.
In C++, it's an error to pass a string literal to a char* function
without a const_cast().  Rather than require every C++ extension
module to put a cast around string literals, fix the API to state the
const-ness.

I focused on parts of the API where people usually pass literals:
PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type
slots, etc.  Predictably, there were a large set of functions that
needed to be fixed as a result of these changes.  The most pervasive
change was to make the keyword args list passed to
PyArg_ParseTupleAndKewords() to be a const char *kwlist[].

One cast was required as a result of the changes:  A type object
mallocs the memory for its tp_doc slot and later frees it.
PyTypeObject says that tp_doc is const char *; but if the type was
created by type_new(), we know it is safe to cast to char *.
2005-12-10 18:50:16 +00:00
Andrew M. Kuchling b5e7ff4aeb Fix check for error condition 2005-06-15 18:46:50 +00:00
Andrew M. Kuchling 52a14c3cdc [Bug #1200134] Fix buffer overflow by constraining size of .getstr(), .instr() to size of allocated buffer 2005-06-09 17:53:27 +00:00
Michael W. Hudson 7d6cc5b303 Fix a leak of a reference on None. 2004-08-04 14:33:28 +00:00
Andrew M. Kuchling 69f31eb80c [Patch #739124] Add use_default_colors() to curses module 2003-08-13 23:11:04 +00:00
Michael W. Hudson 2100798b8c Always call tparm with 10 arguments. It seems it's not varargs i
more often than it is.  In response to bug:

[ 641808 ] Portability of Modules/_cursesmodule.c

submitted by Nick Mclaren.
2002-11-21 14:17:51 +00:00
Andrew M. Kuchling 7e23f00948 [Patch #633635 from David M. Cooke]
Make keyname raise ValueError if passed -1, avoiding a segfault
   Make getkey() match the docs and raise an exception in nodelay mode
   The return type of getch() is int, not chtype
2002-11-06 14:15:36 +00:00
Andrew M. Kuchling 3adefccdcb Use personal e-mail address 2002-10-30 21:08:34 +00:00
Martin v. Löwis c9d07dfc87 Remove duplicate definitions of _XOPEN_SOURCE_EXTENDED. 2002-10-26 13:36:13 +00:00
Martin v. Löwis 21ee4091e1 Patch #615069: Fix build problems on SCO Open Server 5. Backported to 2.2. 2002-09-30 16:19:48 +00:00
Mark Hammond fe51c6d66e Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototype
for Py_Main().

Thanks to Kalle Svensson and Skip Montanaro for the patches.
2002-08-02 02:27:13 +00:00
Michael W. Hudson 67fb0c3705 I think this fixes
[ #510644 ] test_curses segfaults

If we use the *object* *allocator*, we should use the *object* *deallocator*,
not the *raw memory* deallocator (confused yet?).

I think this was what caused segfaults when pymalloc was enabled.

Even if it wasn't the cause, it's still wrong.

2.2.1 candidate.
2002-01-30 15:39:28 +00:00
Martin v. Löwis c0e1671c71 Patch #477752: Drop old-style getargs from curses. 2002-01-17 23:08:27 +00:00
Michael W. Hudson 8f5146088a Change some spaces to tabs. I don't *think* that was me, but it
might have been...
2002-01-16 15:18:09 +00:00
Michael W. Hudson f24281251f Fix for
[ #504284 ] Last build problems on AIX

I'm ignoring the suggestion that this should be an autoconf test in the
interests of having a fix today.  Feel free to quibble.
2002-01-16 15:14:49 +00:00
Guido van Rossum 146483964e Patch supplied by Burton Radons for his own SF bug #487390: Modifying
type.__module__ behavior.

This adds the module name and a dot in front of the type name in every
type object initializer, except for built-in types (and those that
already had this).  Note that it touches lots of Mac modules -- I have
no way to test these but the changes look right.  Apologies if they're
not.  This also touches the weakref docs, which contains a sample type
object initializer.  It also touches the mmap test output, because the
mmap type's repr is included in that output.  It touches object.h to
put the correct description in a comment.
2001-12-08 18:02:58 +00:00
Martin v. Löwis 43f2dc6251 Limit string size on one-character-strings. Fixes #480384. 2001-11-11 14:49:15 +00:00
Martin v. Löwis 00ff10cae4 Patch in bug report #477700: Fix memory leaks in gdbm & curses. 2001-11-11 14:24:05 +00:00
Martin v. Löwis eb9b103296 Check for HP/UX curses problems. Define _XOPEN_SOURCE_EXTENDED and
STRICT_SYSV_CURSES when compiling curses module on HP/UX. Generalize
access to _flags on systems where WINDOW is opaque. Fixes bugs
#432497, #422265, and the curses parts of #467145 and #473150.
2001-10-24 17:10:49 +00:00
Andrew M. Kuchling 16e65a023e Add two forgotten 'break' statements
Allow passing strings to the .border() method
Correct some error messages ("1 or 4" -> "1 to 4")
Bump version number
Tweak code formatting
Update my e-mail address
2001-10-20 16:05:52 +00:00
Martin v. Löwis 1c07b4b4fb Test for __sun instead of __sun__, since SUNWspro only defines the latter;
gcc defines both.
2001-10-13 09:00:42 +00:00