Tim Stumbaugh cca4c51ca4
Update errors in string "Explicit conversions" docs (#4658)
`PyUnicode_DecodeLatin1` requires you to pass in the `error`
parameter. The code as it is in the docs didn't compile.

There is a reference leak in the example
code. `PyUnicode_DecodeLatin1` returns a new reference. Calling
`py::str(PyObject*)` calls `PyObject_Str`, which also returns a new
reference. That reference is managed by the `py::str`
constructor (which correctly steals the reference, using the
`stolen_t` constructor), but the original reference returned by
`PyUnicode_DecodeLatin1` is never decref'd: it never makes it into an
`object`, and it's never manually decremented.

This fixes both of those issues. The code compiles, and I viewed the
sphinx docs locally.
2023-05-09 07:04:20 -07:00
..
2022-07-13 10:13:35 -05:00
2022-02-14 11:36:22 -08:00
2022-02-11 19:06:16 -05:00
2022-03-17 11:21:28 -07:00
2022-02-14 11:36:22 -08:00
2020-10-18 14:31:28 -04:00
2015-10-13 03:16:44 +02:00
2022-07-13 10:13:35 -05:00
2022-07-13 10:13:35 -05:00
2022-02-11 19:06:16 -05:00