Coder Social home page Coder Social logo

Comments (5)

seasalt avatar seasalt commented on August 17, 2024

Thanks . It should help. I noticed last night when was asked to restart my
comp
On Nov 19, 2015 5:26 PM, "Al Sweigart" [email protected] wrote:

Pyperclip doesn't work on WIndows XP 32-bit (and possibly 64-bit too).
When installing, the following output is received:

C:\Python34\Scripts>pip install pyperclip
Collecting pyperclip
Using cached pyperclip-1.5.24.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 20, in
File "C:\DOCUME1\admin\LOCALS1\Temp\pip-build-ncweabkc\pyperclip\setup.p
y", line 8, in
version=import('pyperclip').version,
File "C:\DOCUME1\admin\LOCALS1\Temp\pip-build-ncweabkc\pyperclip\pypercl
ip__init__.py", line 103, in
copy, paste = determine_clipboard()
File "C:\DOCUME1\admin\LOCALS1\Temp\pip-build-ncweabkc\pyperclip\pypercl
ip__init__.py", line 53, in determine_clipboard
return init_windows_clipboard()
File "C:\DOCUME1\admin\LOCALS1\Temp\pip-build-ncweabkc\pyperclip\pypercl
ip\windows.py", line 75, in init_windows_clipboard
wcscpy_s = ctypes.cdll.msvcrt.wcscpy_s
File "C:\Python34\lib\ctypes__init__.py", line 364, in getattr
func = self.getitem(name)
File "C:\Python34\lib\ctypes__init__.py", line 369, in getitem
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'wcscpy_s' not found

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in C:\DOCUME1\admin
\LOCALS
1\Temp\pip-build-ncweabkc\pyperclip

When I try to modify the code to use ctypes.cdll.msvcrt.wcscpy instead of
ctypes.cdll.msvcrt.wcscpy_s, this quick fix just results in this error:

import pyperclip
pyperclip.copy('howdy')
Traceback (most recent call last):
File "", line 1, in
File "C:\Python34\pyperclip\windows.py", line 142, in copy_windows
if wcscpy_s(c_wchar_p(locked_handle), count, c_wchar_p(text)):
OSError: exception: access violation reading 0x00000006

This is probably an issue that wcscpy_s doesn't exist in the old
msvcrt.dll. I was able to replicate this in a VM. I'm not sure if this can
be fixed by updating the dll, but we should come up with a better solution
than that.


Reply to this email directly or view it on GitHub
#51.

from pyperclip.

mhils avatar mhils commented on August 17, 2024

Just my 5 cents: Windows XP is EOL, so IMHO there's really no reason to fix that.

from pyperclip.

drakulavich avatar drakulavich commented on August 17, 2024

I'm not sure, but may be runtime libraries will help?
https://www.microsoft.com/en-us/download/details.aspx?id=30679

from pyperclip.

mhils avatar mhils commented on August 17, 2024

Nonwithstanding my opinion on Windows XP support: IMO the best way to fix that is using memcpy, which we ultimately need to use anyway if we want to support other formats than text.

Edit: The suggestion below is certainly better.

from pyperclip.

hynekcer avatar hynekcer commented on August 17, 2024

The easiest and recommended way to copy memory is ctypes.memmove. It is independent on the platform and libraries.
(It is similarly insecure as memcpy, but in the context of preceding lines it is safe: The same size is copied that had been allocated.)

from pyperclip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.