Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Use bytestring for wallpaper path on Windows #708

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pywal/wallpaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ def set_win_wallpaper(img):
if "x86" in os.environ["PROGRAMFILES"]:
ctypes.windll.user32.SystemParametersInfoW(20, 0, img, 3)
else:
ctypes.windll.user32.SystemParametersInfoA(20, 0, img, 3)
# 'W' funcitons take Unicode strings,
# while 'A' functions take UTF-8 bytestrings.
# (Python 3 strings are Unicode by default.)
ctypes.windll.user32.SystemParametersInfoA(20, 0, str.encode(img), 3)


def change(img):
Expand Down