Skip to content

Commit

Permalink
patch 7.4.1864
Browse files Browse the repository at this point in the history
Problem:    Python: encoding error with Python 2.
Solution:   Use "getcwdu" instead of "getcwd". (Ken Takata)
  • Loading branch information
brammool committed Jun 1, 2016
1 parent 9b0ac22 commit 22081f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/if_py_both.h
Original file line number Diff line number Diff line change
Expand Up @@ -6770,8 +6770,13 @@ populate_module(PyObject *m)
return -1;
ADD_OBJECT(m, "os", other_module);

#if PY_MAJOR_VERSION >= 3
if (!(py_getcwd = PyObject_GetAttrString(other_module, "getcwd")))
return -1;
#else
if (!(py_getcwd = PyObject_GetAttrString(other_module, "getcwdu")))
return -1;
#endif
ADD_OBJECT(m, "_getcwd", py_getcwd)

if (!(py_chdir = PyObject_GetAttrString(other_module, "chdir")))
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1864,
/**/
1863,
/**/
Expand Down

0 comments on commit 22081f4

Please sign in to comment.