Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Lib/test/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -3863,6 +3863,12 @@ def test_spawnve_noargs(self):
self.assertRaises(ValueError, os.spawnve, os.P_NOWAIT, program, ('',), {})
self.assertRaises(ValueError, os.spawnve, os.P_NOWAIT, program, [''], {})

@requires_native_spawnv
def test_spawnve_empty_first_arg_message(self):
with self.assertRaisesRegex(ValueError,
r'^spawnve\(\) arg 2 first element'):
os.spawnve(os.P_NOWAIT, sys.executable, [''], {})

@requires_native_spawnv
def test_spawnv_arg_conversion_errors(self):
# A non-path argv item gets a TypeError naming the argument...
Expand Down
2 changes: 2 additions & 0 deletions Lib/test/test_posix.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ def test_preadv(self):
buf = [bytearray(i) for i in [5, 3, 2]]
self.assertEqual(posix.preadv(fd, buf, 3), 10)
self.assertEqual([b't1tt2', b't3t', b'5t'], list(buf))
with self.assertRaisesRegex(TypeError, r'^preadv\(\) arg 2 '):
posix.preadv(fd, 42, 0)
finally:
os.close(fd)

Expand Down
2 changes: 2 additions & 0 deletions Lib/test/test_tkinter/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,8 @@ def test_wm_attribute(self):
w.wm_attributes(alpha=1.0)
self.assertEqual(w.wm_attributes('alpha'),
1.0 if self.wantobjects else '1.0')
with self.assertRaisesRegex(TypeError, r'^wm_attributes\(\) options'):
w.wm_attributes('alpha', alpha=0.5)

def test_wm_iconbitmap(self):
t = tkinter.Toplevel(self.root)
Expand Down
2 changes: 1 addition & 1 deletion Lib/tkinter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2205,7 +2205,7 @@ def wm_attributes(self, *args, return_python_dict=False, **kwargs):
# TODO: deprecate
return self.tk.call('wm', 'attributes', self._w, *args)
elif args:
raise TypeError('wm_attribute() options have been specified as '
raise TypeError('wm_attributes() options have been specified as '
'positional and keyword arguments')
else:
self.tk.call('wm', 'attributes', self._w, *self._options(kwargs))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix the function names in the error messages of :func:`os.spawnve`,
:func:`os.preadv` and :meth:`tkinter.Wm.wm_attributes`.
4 changes: 2 additions & 2 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -7915,7 +7915,7 @@ os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv,
lastarg = i + 1;
PyErr_SetString(
PyExc_ValueError,
"spawnv() arg 2 first element cannot be empty");
"spawnve() arg 2 first element cannot be empty");
goto fail_1;
}
}
Expand Down Expand Up @@ -11831,7 +11831,7 @@ os_preadv_impl(PyObject *module, int fd, PyObject *buffers, Py_off_t offset,

if (!PySequence_Check(buffers)) {
PyErr_SetString(PyExc_TypeError,
"preadv2() arg 2 must be a sequence");
"preadv() arg 2 must be a sequence");
return -1;
}

Expand Down
Loading