A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-July/067062.html below:

[Python-Dev] import screwiness

[Python-Dev] import screwiness [Python-Dev] import screwinessNeal Norwitz nnorwitz at gmail.com
Thu Jul 6 06:39:08 CEST 2006
In import.c starting around line 1210 (I removed a bunch of code that
doesn't matter for the problem):

                if (PyUnicode_Check(v)) {
                        copy = PyUnicode_Encode(PyUnicode_AS_UNICODE(v),
                                PyUnicode_GET_SIZE(v),
Py_FileSystemDefaultEncoding, NULL);
                        v = copy;
                }
                len = PyString_GET_SIZE(v);
                if (len + 2 + namelen + MAXSUFFIXSIZE >= buflen) {
                        Py_XDECREF(copy);
                        continue; /* Too long */
                }
                strcpy(buf, PyString_AS_STRING(v));

***
So if v is originally unicode, then copy is unicode from the second
line, right?  Then we assign v to copy, so v is still unicode.  Then
later on we do PyString_GET_SIZE and PyString_AS_STRING.  That doesn't
work, does it?  What am I missing?

n
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4