Python ctypes MemoryError in fcgi process from PIL library

后端 未结 3 1940
萌比男神i
萌比男神i 2020-12-16 01:36

I\'m trying to run Django on shared hosting (Bluehost). I\'m using functionality that requires PIL. PIL imports and works from an interactive shell, but in my fcgi process i

3条回答
  •  死守一世寂寞
    2020-12-16 02:10

    I have temporarily fixed that error commenting the last line in this file $HOME/lib/python2.7/ctypes/__init__.py that is something like #CFUNCTYPE(c_int)(lambda: None).

    That's work for me, but i don't know what exactly the problem is.

    UPDATE

    In python 2.7.3 the line number is :279 not the last as I said above.

    UPDATE 2 Since the line may vary between minor versions, you should look for a chunk of code that looks something like this:

    # XXX for whatever reasons, creating the first instance of a callback
    # function is needed for the unittests on Win64 to succeed.  This MAY
    # be a compiler bug, since the problem occurs only when _ctypes is
    # compiled with the MS SDK compiler.  Or an uninitialized variable?
    CFUNCTYPE(c_int)(lambda: None)
    

提交回复
热议问题