Subscribe

raw_input() quick fix part I (bltinmodule.c)

  1. 2006-02-06 09:15:06 PST
    For raw_input() to work, I modified
    builtin_raw_input() in bltinmodule.c with:

    /*------------ bltinmodule_mod.c ------------*/
    char* RawInputChar(char* prompt);

    static PyObject *
    builtin_raw_input(PyObject *self, PyObject *args)
    {
    PyObject *v = NULL;
    char *s;
    int len;

    if (PyArg_UnpackTuple(args, "[raw_]input", 0, 1, &v))
    {
    PyObject *po;
    char *prompt;
    if (v != NULL) {
    po = PyObject_Str(v);
    if (po == NULL)
    return NULL;
    prompt = PyString_AsString(po);
    if (prompt == NULL)
    return NULL;
    }
    else {
    po = NULL;
    prompt = "";
    }

    s = RawInputChar(prompt);

    Py_XDECREF(po);

    len = strlen(s);
    return PyString_FromStringAndSize(s, len);
    }
    return NULL;
    }
  2. 2006-07-03 16:23:47 PDT
    how can i make it work ?
  3. 2006-10-04 01:04:54 PDT
    PythonCE-2.4.3-20060430 still has this problem.

    I did fix it by modification to
    $src\Python\bltinmodule.c ...replace builtin_raw_input()
    $src\PC\dl_nt.c ...add RawInputChar() for dynamic dialog

    This change is made to "python24.dll" only.
    Total size: 67K

    I can email to you by request.
    Sorry, I don't know how to contribute to the project.
    Anyone can help?

    --santiwk
  4. 2006-10-05 19:59:31 PDT
    Thank to "infidel".
    The uploaded url is here:
    http://sourceforge.net/tracker/index.php?func=detail&aid=1571827&group_id=104228&atid=637342
Jump To:
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.