* OS/2
* Windows 2000
+* VMS
Deprecated Python modules, functions and methods
#ifdef MS_WINDOWS
PyAPI_DATA(PyObject *) PyExc_WindowsError;
#endif
-#ifdef __VMS
-PyAPI_DATA(PyObject *) PyExc_VMSError;
-#endif
PyAPI_DATA(PyObject *) PyExc_RecursionErrorInst;
e.characters_written = 5
self.assertEqual(e.characters_written, 5)
- # XXX VMSError not tested
-
class ExplicitSubclassingTest(unittest.TestCase):
Build
-----
+- Issue #16136: Remove VMS support
+
- Issue #18215: Add script Tools/ssl/test_multiple_versions.py to compile and
run Python's unit tests with multiple versions of OpenSSL.
#include <sys/types.h>
-#ifdef __VMS
-#include <openssl/des.h>
-#endif
-
/* Module crypt */
static PyObject *crypt_crypt(PyObject *self, PyObject *args)
{
char *word, *salt;
-#ifndef __VMS
- extern char * crypt(const char *, const char *);
-#endif
if (!PyArg_ParseTuple(args, "ss:crypt", &word, &salt)) {
return NULL;
return NULL;
}
Py_BEGIN_ALLOW_THREADS
-#ifdef __VMS
- ret = ioctl(fd, code, (void *)arg);
-#else
ret = ioctl(fd, code, arg);
-#endif
Py_END_ALLOW_THREADS
if (ret < 0) {
PyErr_SetFromErrno(PyExc_IOError);
#if defined(__FreeBSD__)
# include <ieeefp.h>
-#elif defined(__VMS)
-#define __NEW_STARLET
-#include <starlet.h>
-#include <ieeedef.h>
#endif
#ifndef WANT_SIGFPE_HANDLER
ieee_set_fp_control(fp_control);
PyOS_setsig(SIGFPE, handler);
-/*-- DEC ALPHA VMS --------------------------------------------------------*/
-#elif defined(__ALPHA) && defined(__VMS)
- IEEE clrmsk;
- IEEE setmsk;
- clrmsk.ieee$q_flags =
- IEEE$M_TRAP_ENABLE_UNF | IEEE$M_TRAP_ENABLE_INE |
- IEEE$M_MAP_UMZ;
- setmsk.ieee$q_flags =
- IEEE$M_TRAP_ENABLE_INV | IEEE$M_TRAP_ENABLE_DZE |
- IEEE$M_TRAP_ENABLE_OVF;
- sys$ieee_set_fp_control(&clrmsk, &setmsk, 0);
- PyOS_setsig(SIGFPE, handler);
-
-/*-- HP IA64 VMS --------------------------------------------------------*/
-#elif defined(__ia64) && defined(__VMS)
- PyOS_setsig(SIGFPE, handler);
-
/*-- Cray Unicos ----------------------------------------------------------*/
#elif defined(cray)
/* UNICOS delivers SIGFPE by default, but no matherr */
#ifdef __FreeBSD__
fpresetsticky(fpgetsticky());
fpsetmask(0);
-#elif defined(__VMS)
- IEEE clrmsk;
- clrmsk.ieee$q_flags =
- IEEE$M_TRAP_ENABLE_UNF | IEEE$M_TRAP_ENABLE_INE |
- IEEE$M_MAP_UMZ | IEEE$M_TRAP_ENABLE_INV |
- IEEE$M_TRAP_ENABLE_DZE | IEEE$M_TRAP_ENABLE_OVF |
- IEEE$M_INHERIT;
- sys$ieee_set_fp_control(&clrmsk, 0, 0);
#else
fputs("Operation not implemented\n", stderr);
#endif
#endif
#ifndef PREFIX
-# ifdef __VMS
-# define PREFIX ""
-# else
-# define PREFIX "/usr/local"
-# endif
+# define PREFIX "/usr/local"
#endif
#ifndef EXEC_PREFIX
#define SET(i,val) PyStructSequence_SET_ITEM(v, i, val)
SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_name));
-#ifdef __VMS
- SET(setIndex++, Py_None);
- Py_INCREF(Py_None);
-#else
if (p->gr_passwd)
SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_passwd));
else {
SET(setIndex++, Py_None);
Py_INCREF(Py_None);
}
-#endif
SET(setIndex++, _PyLong_FromGid(p->gr_gid));
SET(setIndex++, w);
#undef SET
#include <locale.h>
-#ifdef __VMS
-#error "PEP 11: VMS is now unsupported, code will be removed in Python 3.4"
-#include <unixlib.h>
-#endif
-
#if defined(MS_WINDOWS) || defined(__CYGWIN__)
#include <windows.h>
#ifdef HAVE_FCNTL_H
fprintf(f, usage_5, DELIM, PYTHONHOMEHELP);
fputs(usage_6, f);
}
-#if defined(__VMS)
- if (exitcode == 0) {
- /* suppress 'error' message */
- return 1;
- }
- else {
- /* STS$M_INHIB_MSG + SS$_ABORT */
- return 0x1000002c;
- }
-#else
return exitcode;
-#endif
- /*NOTREACHED*/
}
static void RunStartupFile(PyCompilerFlags *cf)
if (command == NULL && module == NULL && _PyOS_optind < argc &&
wcscmp(argv[_PyOS_optind], L"-") != 0)
{
-#ifdef __VMS
- filename = decc$translate_vms(argv[_PyOS_optind]);
- if (filename == (char *)0 || filename == (char *)-1)
- filename = argv[_PyOS_optind];
-
-#else
filename = argv[_PyOS_optind];
-#endif
}
stdin_is_interactive = Py_FdIsInteractive(stdin, (char *)0);
#endif /* !MS_WINDOWS */
/* Leave stderr alone - it should be unbuffered anyway. */
}
-#ifdef __VMS
- else {
- setvbuf (stdout, (char *)NULL, _IOLBF, BUFSIZ);
- }
-#endif /* __VMS */
#ifdef __APPLE__
/* On MacOS X, when the Python interpreter is embedded in an
(void)fcntl(fd, F_FULLFSYNC);
#endif
#ifdef HAVE_FSTAT
-# ifdef __VMS
- /* on OpenVMS we must ensure that all bytes are written to the file */
- if (fd != -1) {
- fsync(fd);
- }
-# endif
if (fd != -1 && fstat(fd, &st) == 0 && S_ISREG(st.st_mode)) {
if (map_size == 0) {
if (st.st_size == 0) {
#include "posixmodule.h"
#endif
-#if defined(__VMS)
-# error "PEP 11: VMS is now unsupported, code will be removed in Python 3.4"
-# include <unixio.h>
-#endif /* defined(__VMS) */
-
#ifdef __cplusplus
extern "C" {
#endif
#define HAVE_FSYNC 1
#define fsync _commit
#else
-#if defined(__VMS)
-/* Everything needed is defined in vms/pyconfig.h */
-#else /* all other compilers */
/* Unix functions that the configure script doesn't check for */
#define HAVE_EXECV 1
#define HAVE_FORK 1
#define HAVE_SYSTEM 1
#define HAVE_WAIT 1
#define HAVE_TTYNAME 1
-#endif /* __VMS */
#endif /* _MSC_VER */
#endif /* __BORLANDC__ */
#endif /* ! __WATCOMC__ || __QNX__ */
{
char *ret;
-#if defined(__VMS)
- /* file descriptor 0 only, the default input device (stdin) */
- if (fd == 0) {
- ret = ttyname();
- }
- else {
- ret = NULL;
- }
-#else
ret = ttyname(fd);
-#endif
if (ret == NULL)
posix_error();
return ret;
int res;
if (!PyArg_ParseTuple(args, "i:fstat", &fd))
return NULL;
-#ifdef __VMS
- /* on OpenVMS we must ensure that all bytes are written to the file */
- fsync(fd);
-#endif
Py_BEGIN_ALLOW_THREADS
res = FSTAT(fd, &st);
Py_END_ALLOW_THREADS
#define SETS(i,val) sets(v, i, val)
SETS(setIndex++, p->pw_name);
-#ifdef __VMS
- SETS(setIndex++, "");
-#else
SETS(setIndex++, p->pw_passwd);
-#endif
PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromUid(p->pw_uid));
PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromGid(p->pw_gid));
-#ifdef __VMS
- SETS(setIndex++, "");
-#else
SETS(setIndex++, p->pw_gecos);
-#endif
SETS(setIndex++, p->pw_dir);
SETS(setIndex++, p->pw_shell);
# include <winsock.h>
#else
# define SOCKET int
-# if defined(__VMS)
-# include <socket.h>
-# endif
#endif
/* list of Python objects and their file descriptor */
* kevent is not standard and its members vary across BSDs.
*/
#if !defined(__OpenBSD__)
-# define IDENT_TYPE T_UINTPTRT
-# define IDENT_CAST Py_intptr_t
-# define DATA_TYPE T_INTPTRT
+# define IDENT_TYPE T_UINTPTRT
+# define IDENT_CAST Py_intptr_t
+# define DATA_TYPE T_INTPTRT
# define DATA_FMT_UNIT INTPTRT_FMT_UNIT
-# define IDENT_AsType PyLong_AsUintptr_t
+# define IDENT_AsType PyLong_AsUintptr_t
#else
-# define IDENT_TYPE T_UINT
-# define IDENT_CAST int
-# define DATA_TYPE T_INT
+# define IDENT_TYPE T_UINT
+# define IDENT_CAST int
+# define DATA_TYPE T_INT
# define DATA_FMT_UNIT "i"
-# define IDENT_AsType PyLong_AsUnsignedLong
+# define IDENT_AsType PyLong_AsUnsignedLong
#endif
/* Unfortunately, we can't store python objects in udata, because
if (PyLong_Check(pfd)
#if IDENT_TYPE == T_UINT
- && PyLong_AsUnsignedLong(pfd) <= UINT_MAX
+ && PyLong_AsUnsignedLong(pfd) <= UINT_MAX
#endif
) {
self->e.ident = IDENT_AsType(pfd);
that are ready.\n\
\n\
*** IMPORTANT NOTICE ***\n\
-On Windows and OpenVMS, only sockets are supported; on Unix, all file\n\
+On Windows only sockets are supported; on Unix, all file\n\
descriptors can be used.");
static PyMethodDef select_methods[] = {
"This module supports asynchronous I/O on multiple file descriptors.\n\
\n\
*** IMPORTANT NOTICE ***\n\
-On Windows and OpenVMS, only sockets are supported; on Unix, all file descriptors.");
+On Windows only sockets are supported; on Unix, all file descriptors.");
static struct PyModuleDef selectmodule = {
#if defined(WITH_THREAD) && (defined(__APPLE__) || \
(defined(__FreeBSD__) && __FreeBSD_version+0 < 503000) || \
defined(__OpenBSD__) || defined(__NetBSD__) || \
- defined(__VMS) || !defined(HAVE_GETADDRINFO))
+ !defined(HAVE_GETADDRINFO))
#define USE_GETADDRINFO_LOCK
#endif
# include <ctype.h>
#endif
-#if defined(__VMS)
-# include <ioctl.h>
-#endif
-
#ifdef __APPLE__
# include <sys/ioctl.h>
#endif
#endif
#endif
-#ifdef __VMS
-/* TCP/IP Services for VMS uses a maximum send/recv buffer length */
-#define SEGMENT_SIZE (32 * 1024 -1)
-#endif
-
/* Convert "sock_addr_t *" to "struct sockaddr *". */
#define SAS2SA(x) (&((x)->sa))
return NULL;
}
-#ifdef __VMS
-/* Function to send in segments */
-static int
-sendsegmented(int sock_fd, char *buf, int len, int flags)
-{
- int n = 0;
- int remaining = len;
-
- while (remaining > 0) {
- unsigned int segment;
-
- segment = (remaining >= SEGMENT_SIZE ? SEGMENT_SIZE : remaining);
- n = send(sock_fd, buf, segment, flags);
- if (n < 0) {
- return n;
- }
- remaining -= segment;
- buf += segment;
- } /* end while */
-
- return len;
-}
-#endif
-
/* Function to perform the setting of socket blocking mode
internally. block = (1 | 0). */
static int
internal_setblocking(PySocketSockObject *s, int block)
{
#if !defined(MS_WINDOWS) \
- && !((defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO)) || defined(__VMS))
+ && !((defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO)))
int delay_flag, new_delay_flag;
#endif
#ifdef SOCK_NONBLOCK
Py_BEGIN_ALLOW_THREADS
#ifndef MS_WINDOWS
-#if (defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO)) || defined(__VMS)
+#if (defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO))
block = !block;
ioctl(s->sock_fd, FIONBIO, (unsigned int *)&block);
#else
return s->errorhandler();
return PyLong_FromLong(flag);
}
-#ifdef __VMS
- /* socklen_t is unsigned so no negative test is needed,
- test buflen == 0 is previously done */
- if (buflen > 1024) {
-#else
if (buflen <= 0 || buflen > 1024) {
-#endif
PyErr_SetString(PyExc_OSError,
"getsockopt buflen out of range");
return NULL;
{
Py_ssize_t outlen = -1;
int timeout;
-#ifdef __VMS
- int remaining;
- char *read_buf;
-#endif
if (!IS_SELECTABLE(s)) {
select_error();
return 0;
}
-#ifndef __VMS
BEGIN_SELECT_LOOP(s)
Py_BEGIN_ALLOW_THREADS
timeout = internal_select_ex(s, 0, interval);
s->errorhandler();
return -1;
}
-#else
- read_buf = cbuf;
- remaining = len;
- while (remaining != 0) {
- unsigned int segment;
- int nread = -1;
-
- segment = remaining /SEGMENT_SIZE;
- if (segment != 0) {
- segment = SEGMENT_SIZE;
- }
- else {
- segment = remaining;
- }
-
- BEGIN_SELECT_LOOP(s)
- Py_BEGIN_ALLOW_THREADS
- timeout = internal_select_ex(s, 0, interval);
- if (!timeout)
- nread = recv(s->sock_fd, read_buf, segment, flags);
- Py_END_ALLOW_THREADS
- if (timeout == 1) {
- PyErr_SetString(socket_timeout, "timed out");
- return -1;
- }
- END_SELECT_LOOP(s)
-
- if (nread < 0) {
- s->errorhandler();
- return -1;
- }
- if (nread != remaining) {
- read_buf += nread;
- break;
- }
-
- remaining -= segment;
- read_buf += segment;
- }
- outlen = read_buf - cbuf;
-#endif /* !__VMS */
-
return outlen;
}
Py_BEGIN_ALLOW_THREADS
timeout = internal_select_ex(s, 1, interval);
if (!timeout) {
-#ifdef __VMS
- n = sendsegmented(s->sock_fd, buf, len, flags);
-#elif defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
if (len > INT_MAX)
len = INT_MAX;
n = send(s->sock_fd, buf, (int)len, flags);
timeout = internal_select(s, 1);
n = -1;
if (!timeout) {
-#ifdef __VMS
- n = sendsegmented(s->sock_fd, buf, len, flags);
-#elif defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
if (len > INT_MAX)
len = INT_MAX;
n = send(s->sock_fd, buf, (int)len, flags);
#if defined(__APPLE__) && defined(AI_NUMERICSERV)
if ((flags & AI_NUMERICSERV) && (pptr == NULL || (pptr[0] == '0' && pptr[1] == 0))) {
/* On OSX upto at least OSX 10.8 getaddrinfo crashes
- * if AI_NUMERICSERV is set and the servname is NULL or "0".
- * This workaround avoids a segfault in libsystem.
- */
+ * if AI_NUMERICSERV is set and the servname is NULL or "0".
+ * This workaround avoids a segfault in libsystem.
+ */
pptr = "00";
}
#endif
#ifdef MS_WINDOWS
PyObject *PyExc_WindowsError = NULL;
#endif
-#ifdef __VMS
-PyObject *PyExc_VMSError = NULL;
-#endif
/* The dict map from errno codes to OSError subclasses */
static PyObject *errnomap = NULL;
INIT_ALIAS(IOError, OSError)
#ifdef MS_WINDOWS
INIT_ALIAS(WindowsError, OSError)
-#endif
-#ifdef __VMS
- INIT_ALIAS(VMSError, OSError)
#endif
POST_INIT(EOFError)
POST_INIT(RuntimeError)
#include "windows.h"
#endif /* MS_WINDOWS */
-#ifdef __VMS
-extern char* vms__StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt);
-#endif
-
PyThreadState* _PyOS_ReadlineTState;
if (PyOS_ReadlineFunctionPointer == NULL) {
-#ifdef __VMS
- PyOS_ReadlineFunctionPointer = vms__StdioReadline;
-#else
PyOS_ReadlineFunctionPointer = PyOS_StdioReadline;
-#endif
}
#ifdef WITH_THREAD
#ifdef __CYGWIN__
".dll",
#else /* !__CYGWIN__ */
-#ifdef __VMS
- ".exe",
- ".EXE",
-#else /* !__VMS */
"." SOABI ".so",
".abi" PYTHON_ABI_STRING ".so",
".so",
-#endif /* __VMS */
#endif /* __CYGWIN__ */
NULL,
};
static struct {
dev_t dev;
-#ifdef __VMS
- ino_t ino[3];
-#else
ino_t ino;
-#endif
void *handle;
} handles[128];
static int nhandles = 0;
}
if (nhandles < 128) {
handles[nhandles].dev = statb.st_dev;
-#ifdef __VMS
- handles[nhandles].ino[0] = statb.st_ino[0];
- handles[nhandles].ino[1] = statb.st_ino[1];
- handles[nhandles].ino[2] = statb.st_ino[2];
-#else
handles[nhandles].ino = statb.st_ino;
-#endif
}
}
dlopenflags = PyThreadState_GET()->interp->dlopenflags;
-#ifdef __VMS
- /* VMS currently don't allow a pathname, use a logical name instead */
- /* Concatenate 'python_module_' and shortname */
- /* so "import vms.bar" will use the logical python_module_bar */
- /* As C module use only one name space this is probably not a */
- /* important limitation */
- PyOS_snprintf(pathbuf, sizeof(pathbuf), "python_module_%-.200s",
- shortname);
- pathname = pathbuf;
-#endif
-
handle = dlopen(pathname, dlopenflags);
if (handle == NULL) {
#endif /* MS_WINDOWS */
-#ifdef __VMS
-/* Use openssl random routine */
-#include <openssl/rand.h>
-static int
-vms_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
-{
- if (RAND_pseudo_bytes(buffer, size) < 0) {
- if (raise) {
- PyErr_Format(PyExc_ValueError,
- "RAND_pseudo_bytes");
- } else {
- Py_FatalError("Failed to initialize the randomized hash "
- "secret using RAND_pseudo_bytes");
- }
- return -1;
- }
- return 0;
-}
-#endif /* __VMS */
-
-
-#if !defined(MS_WINDOWS) && !defined(__VMS)
+#ifndef MS_WINDOWS
static int urandom_fd = -1;
/* Read size bytes from /dev/urandom into buffer.
}
}
-#endif /* !defined(MS_WINDOWS) && !defined(__VMS) */
+#endif /* MS_WINDOWS */
/* Fill buffer with pseudo-random bytes generated by a linear congruent
generator (LCG):
#ifdef MS_WINDOWS
return win32_urandom((unsigned char *)buffer, size, 1);
#else
-# ifdef __VMS
- return vms_urandom((unsigned char *)buffer, size, 1);
-# else
return dev_urandom_python((char*)buffer, size);
-# endif
#endif
}
else {
#ifdef MS_WINDOWS
(void)win32_urandom(secret, secret_size, 0);
-#else /* #ifdef MS_WINDOWS */
-# ifdef __VMS
- vms_urandom(secret, secret_size, 0);
-# else
+#else
dev_urandom_noraise(secret, secret_size);
-# endif
#endif
}
}
void
_PyRandom_Fini(void)
{
-#if !defined(MS_WINDOWS) && !defined(__VMS)
+#ifndef MS_WINDOWS
dev_urandom_close();
#endif
}
extern const char *PyWin_DLLVersionString;
#endif
-#ifdef __VMS
-#include <unixlib.h>
-#endif
-
#ifdef HAVE_LANGINFO_H
#include <locale.h>
#include <langinfo.h>
if (av != NULL) {
int i;
for (i = 0; i < argc; i++) {
-#ifdef __VMS
- PyObject *v;
-
- /* argv[0] is the script pathname if known */
- if (i == 0) {
- char* fn = decc$translate_vms(argv[0]);
- if ((fn == (char *)0) || fn == (char *)-1)
- v = PyUnicode_FromString(argv[0]);
- else
- v = PyUnicode_FromString(
- decc$translate_vms(argv[0]));
- } else
- v = PyUnicode_FromString(argv[i]);
-#else
PyObject *v = PyUnicode_FromWideChar(argv[i], -1);
-#endif
if (v == NULL) {
Py_DECREF(av);
av = NULL;