Skip to content

Commit 54cf12b

Browse files
author
Sean Reifscheider
committed
Fixing the spelling of "writeable" to "writable", particularly PyBUF_WRITEABLE.
1 parent a5b8e04 commit 54cf12b

File tree

13 files changed

+33
-31
lines changed

13 files changed

+33
-31
lines changed

Doc/c-api/abstract.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ Buffer Protocol
944944

945945
.. cfunction:: int PyObject_AsWriteBuffer(PyObject *obj, void **buffer, Py_ssize_t *buffer_len)
946946

947-
Returns a pointer to a writeable memory location. The *obj* argument must
947+
Returns a pointer to a writable memory location. The *obj* argument must
948948
support the single-segment, character buffer interface. On success, returns
949949
``0``, sets *buffer* to the memory location and *buffer_len* to the buffer
950950
length. Returns ``-1`` and sets a :exc:`TypeError` on error.

Doc/c-api/concrete.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,7 @@ could be used to pass around structured data in its native, in-memory format.
18821882

18831883
Return a new writable buffer object. Parameters and exceptions are similar to
18841884
those for :cfunc:`PyBuffer_FromObject`. If the *base* object does not export
1885-
the writeable buffer protocol, then :exc:`TypeError` is raised.
1885+
the writable buffer protocol, then :exc:`TypeError` is raised.
18861886

18871887

18881888
.. cfunction:: PyObject* PyBuffer_FromMemory(void *ptr, Py_ssize_t size)

Include/abstract.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,9 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
524524
Py_ssize_t *buffer_len);
525525

526526
/*
527-
Takes an arbitrary object which must support the (writeable,
527+
Takes an arbitrary object which must support the (writable,
528528
single segment) buffer interface and returns a pointer to a
529-
writeable memory location in buffer of size buffer_len.
529+
writable memory location in buffer of size buffer_len.
530530
531531
0 is returned on success. buffer and buffer_len are only
532532
set in case no error occurrs. Otherwise, -1 is returned and

Include/memoryobject.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base, int buffertype
3333
3434
The buffertype argument can be PyBUF_READ, PyBUF_WRITE,
3535
PyBUF_UPDATEIFCOPY to determine whether the returned buffer
36-
should be READONLY, WRITEABLE, or set to update the
36+
should be READONLY, WRITABLE, or set to update the
3737
original buffer if a copy must be made. If buffertype is
3838
PyBUF_WRITE and the buffer is not contiguous an error will
3939
be raised. In this circumstance, the user can use
40-
PyBUF_UPDATEIFCOPY to ensure that a a writeable temporary
40+
PyBUF_UPDATEIFCOPY to ensure that a a writable temporary
4141
contiguous buffer is returned. The contents of this
4242
contiguous buffer will be copied back into the original
4343
object after the memoryview object is deleted as long as
44-
the original object is writeable and allows setting its
44+
the original object is writable and allows setting its
4545
memory to "readonly". If this is not allowed by the
4646
original object, then a BufferError is raised.
4747

Include/object.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ typedef void (*releasebufferproc)(PyObject *, PyBuffer *);
162162
/* Flags for getting buffers */
163163
#define PyBUF_SIMPLE 0
164164
#define PyBUF_CHARACTER 1
165-
#define PyBUF_WRITEABLE 0x0002
165+
#define PyBUF_WRITABLE 0x0002
166+
/* we used to include an E, backwards compatible alias */
167+
#define PyBUF_WRITEABLE PyBUF_WRITABLE
166168
#define PyBUF_LOCKDATA 0x0004
167169
#define PyBUF_FORMAT 0x0008
168170
#define PyBUF_ND 0x0010
@@ -172,19 +174,19 @@ typedef void (*releasebufferproc)(PyObject *, PyBuffer *);
172174
#define PyBUF_ANY_CONTIGUOUS (0x0100 | PyBUF_STRIDES)
173175
#define PyBUF_INDIRECT (0x0200 | PyBUF_STRIDES)
174176

175-
#define PyBUF_CONTIG (PyBUF_ND | PyBUF_WRITEABLE)
177+
#define PyBUF_CONTIG (PyBUF_ND | PyBUF_WRITABLE)
176178
#define PyBUF_CONTIG_RO (PyBUF_ND)
177179
#define PyBUF_CONTIG_LCK (PyBUF_ND | PyBUF_LOCKDATA)
178180

179-
#define PyBUF_STRIDED (PyBUF_STRIDES | PyBUF_WRITEABLE)
181+
#define PyBUF_STRIDED (PyBUF_STRIDES | PyBUF_WRITABLE)
180182
#define PyBUF_STRIDED_RO (PyBUF_STRIDES)
181183
#define PyBUF_STRIDED_LCK (PyBUF_STRIDES | PyBUF_LOCKDATA)
182184

183-
#define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_WRITEABLE | PyBUF_FORMAT)
185+
#define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_WRITABLE | PyBUF_FORMAT)
184186
#define PyBUF_RECORDS_RO (PyBUF_STRIDES | PyBUF_FORMAT)
185187
#define PyBUF_RECORDS_LCK (PyBUF_STRIDES | PyBUF_LOCKDATA | PyBUF_FORMAT)
186188

187-
#define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_WRITEABLE | PyBUF_FORMAT)
189+
#define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_WRITABLE | PyBUF_FORMAT)
188190
#define PyBUF_FULL_RO (PyBUF_INDIRECT | PyBUF_FORMAT)
189191
#define PyBUF_FULL_LCK (PyBUF_INDIRECT | PyBUF_LOCKDATA | PyBUF_FORMAT)
190192

Lib/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,7 @@ class _Prop_format(aetools.NProperty):
13461346
which = 'Frmt'
13471347
want = 'PthF'
13481348
class _Prop_framework(aetools.NProperty):
1349-
"""framework - Is the path a Mac OS X framework style path? (This flag is readable but not writeable from AppleScript.) """
1349+
"""framework - Is the path a Mac OS X framework style path? (This flag is readable but not writable from AppleScript.) """
13501350
which = 'Frmw'
13511351
want = 'bool'
13521352
class _Prop_host_flags(aetools.NProperty):

Lib/plat-mac/macresource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def _decode(pathname, verbose=0):
135135
return newpathname
136136
if hasattr(os, 'access') and not \
137137
os.access(os.path.dirname(pathname), os.W_OK|os.X_OK):
138-
# The destination directory isn't writeable. Create the file in
138+
# The destination directory isn't writable. Create the file in
139139
# a temporary directory
140140
import tempfile
141141
fd, newpathname = tempfile.mkstemp(".rsrc")

Misc/HISTORY

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ Extension modules
403403
- os.urandom has been added for systems that support sources of random
404404
data.
405405

406-
- Patch 1012740: truncate() on a writeable cStringIO now resets the
406+
- Patch 1012740: truncate() on a writable cStringIO now resets the
407407
position to the end of the stream. This is consistent with the original
408408
StringIO module and avoids inadvertently resurrecting data that was
409409
supposed to have been truncated away.

Misc/setuid-prog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ main(int argc, char **argv)
155155
fprintf(stderr, "%s: %s has the wrong owner\n", argv[0],
156156
FULL_PATH);
157157
fprintf(stderr, "The script should be owned by root,\n");
158-
fprintf(stderr, "and shouldn't be writeable by anyone.\n");
158+
fprintf(stderr, "and shouldn't be writable by anyone.\n");
159159
exit(1);
160160
}
161161

Modules/mmapmodule.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ mmap_find_method(mmap_object *self,
272272
}
273273

274274
static int
275-
is_writeable(mmap_object *self)
275+
is_writable(mmap_object *self)
276276
{
277277
if (self->access != ACCESS_READ)
278278
return 1;
@@ -307,7 +307,7 @@ mmap_write_method(mmap_object *self,
307307
if (!PyArg_ParseTuple(args, "s#:write", &data, &length))
308308
return(NULL);
309309

310-
if (!is_writeable(self))
310+
if (!is_writable(self))
311311
return NULL;
312312

313313
if ((self->pos + length) > self->size) {
@@ -330,7 +330,7 @@ mmap_write_byte_method(mmap_object *self,
330330
if (!PyArg_ParseTuple(args, "c:write_byte", &value))
331331
return(NULL);
332332

333-
if (!is_writeable(self))
333+
if (!is_writable(self))
334334
return NULL;
335335
*(self->data+self->pos) = value;
336336
self->pos += 1;
@@ -562,7 +562,7 @@ mmap_move_method(mmap_object *self, PyObject *args)
562562
unsigned long dest, src, count;
563563
CHECK_VALID(NULL);
564564
if (!PyArg_ParseTuple(args, "kkk:move", &dest, &src, &count) ||
565-
!is_writeable(self)) {
565+
!is_writable(self)) {
566566
return NULL;
567567
} else {
568568
/* bounds check the values */
@@ -733,7 +733,7 @@ mmap_ass_item(mmap_object *self, Py_ssize_t i, PyObject *v)
733733
"mmap assignment must be length-1 bytes()");
734734
return -1;
735735
}
736-
if (!is_writeable(self))
736+
if (!is_writable(self))
737737
return -1;
738738
buf = PyBytes_AsString(v);
739739
self->data[i] = buf[0];
@@ -768,7 +768,7 @@ mmap_ass_subscript(mmap_object *self, PyObject *item, PyObject *value)
768768
"mmap assignment must be length-1 bytes()");
769769
return -1;
770770
}
771-
if (!is_writeable(self))
771+
if (!is_writable(self))
772772
return -1;
773773
buf = PyBytes_AsString(value);
774774
self->data[i] = buf[0];
@@ -797,7 +797,7 @@ mmap_ass_subscript(mmap_object *self, PyObject *item, PyObject *value)
797797
"mmap slice assignment is wrong size");
798798
return -1;
799799
}
800-
if (!is_writeable(self))
800+
if (!is_writable(self))
801801
return -1;
802802

803803
if (slicelen == 0)

0 commit comments

Comments
 (0)