Skip to content

(Jython <=2.7.2) ImportError: cannot import name c_wchar_p #2

@n00b-bot

Description

@n00b-bot

When I use pyperclip library
import pyperclip
It shows the following errors:

Traceback (most recent call last):
  File "C:\Users\Nothing\AppData\Roaming\BurpSuite\bapps\67f5c31f93d04ad3a3b0a1808b3648fa\ElasticBurp.py", line 36, in <module>
    import pyperclip 
  File "C:\Users\Nothing\AppData\Roaming\BurpSuite\bapps\67f5c31f93d04ad3a3b0a1808b3648fa\BappModules\pyperclip\__init__.py", line 60, in <module>
    from ctypes import c_size_t, sizeof, c_wchar_p, get_errno, c_wchar
ImportError: cannot import name c_wchar_p

Sumary

First I think this error is due to Windows but it also happens on Linux.
After searching on Google, some types of ctypes only support CPython, and other such as Jython does not have this type. Here is all types of ctypes on Jython.

['CDLL', 'LibraryLoader', 'POINTER', 'Structure', 'Union', '_AggregateMetaClass', '_ArrayCData', '_CData', '_CTypeMetaClass', '_Function', '_ScalarCData', '_StructLayoutBuilder', '_StructMetaClass', '_TypeMap', '_UnionMetaClass', '__builtins__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__version__', '_pointer_type_cache', 'addressof', 'alignment', 'byref', 'c_bool', 'c_byte', 'c_char_p', 'c_double', 'c_float', 'c_int', 'c_int16', 'c_int32', 'c_int64', 'c_int8', 'c_long', 'c_longlong', 'c_short', 'c_size_t', 'c_ssize_t', 'c_ubyte', 'c_uint', 'c_uint16', 'c_uint32', 'c_uint64', 'c_uint8', 'c_ulong', 'c_ulonglong', 'c_ushort', 'c_void_p', 'cdll', 'jffi', 'memmove', 'memset', 'pointer', 'sizeof']

Solution

Not yet. I will update when finding out the solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions