-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
bpo-21071: struct.Struct.format type is now str #845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -374,6 +374,9 @@ Extension Modules | |
| Library | ||
| ------- | ||
|
|
||
| - bpo-21071: struct.Struct.format type is now :class:`str` instead of | ||
|
||
| :class:`bytes`. | ||
|
|
||
| - bpo-29212: Fix concurrent.futures.thread.ThreadPoolExecutor threads to have | ||
| a non repr() based thread name by default when no thread_name_prefix is | ||
| supplied. They will now identify themselves as "ThreadPoolExecutor-y_n". | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1957,8 +1957,8 @@ s_pack_into(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames | |
| static PyObject * | ||
| s_get_format(PyStructObject *self, void *unused) | ||
| { | ||
| Py_INCREF(self->s_format); | ||
| return self->s_format; | ||
| return PyUnicode_FromStringAndSize(PyBytes_AS_STRING(self->s_format), | ||
|
||
| PyBytes_GET_SIZE(self->s_format)); | ||
| } | ||
|
|
||
| static PyObject * | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO,
self.assertIsInstance(s.format, str)would be better to understand (for future readers) the behavior change.