Open ryneches opened 2 years ago
Invoking pyperclip.copy() inside a script breaks the script's STDOUT redirection on the command line.
Create a file called copy.py :
copy.py
#!/usr/bin/env python import pyperclip pyperclip.copy( 'hello world!' ) print( 'foo' )
Run the script from the terminal :
$ ./copy.py foo $
The paste buffer now contains the text "hello world!" However, if you try to capture STDOUT, the script hangs :
$ ./copy.py | grep bar <<hangs>>
@ryneches I tried in a fresh virtualenv, can't repeat the problem. Versions tried: 3.7.13, 3.8.13, 3.9.13, 3.10.4, with pyenv. macOS 13.0.1 GNU bash, version 5.0.17(1)-release (x86_64-apple-darwin19.4.0)
Invoking pyperclip.copy() inside a script breaks the script's STDOUT redirection on the command line.
Create a file called
copy.py
:Run the script from the terminal :
The paste buffer now contains the text "hello world!" However, if you try to capture STDOUT, the script hangs :