Skip to content

clipboard with an image errors (windows) #47913

Open
@MarcMush

Description

@MarcMush

#46981 still happens, not when the clipboard is empty, but when there is an image in the clipboard

to reproduce, copy an image (outside Julia), then type clipboard() in the Julia terminal:

PS C:\Users\Marc> julia +1.7 --startup-file no
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.7.3 (2022-05-06)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> clipboard()
""

julia>
PS C:\Users\Marc> julia +alpha --startup-file no
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.0-alpha1 (2022-11-15)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> clipboard()
ERROR: SystemError: GetClipboardData: L’opération a réussi.
Stacktrace:
 [1] windowserror(p::Symbol, code::UInt32; extrainfo::Nothing)
   @ Base .\error.jl:191
 [2] windowserror(p::Symbol, code::UInt32)
   @ Base .\error.jl:191
 [3] cleanup
   @ C:\Users\Marc\.julia\juliaup\julia-1.9.0-alpha1+0.x64.w64.mingw32\share\julia\stdlib\v1.9\InteractiveUtils\src\clipboard.jl:118 [inlined]
 [4] clipboard()
   @ InteractiveUtils C:\Users\Marc\.julia\juliaup\julia-1.9.0-alpha1+0.x64.w64.mingw32\share\julia\stdlib\v1.9\InteractiveUtils\src\clipboard.jl:125
 [5] top-level scope
   @ REPL[1]:1

the error doesn't happen in 1.7, but it does happen in 1.8.3 (where I believe #47311 was merged) and 1.9-alpha

Note that in 1.7, it appeared as an empty string, even though there is actually an image in the clipboard. 1.8.3 or 1.9 doesn't error with an empty string

Also note that ironically, the error message "L’opération a réussi" means "The operation succeeded" in French (my system language)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions