Skip to content

Commit

Permalink
cast to char* before casting to wchar_t
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisBarker-NOAA committed Mar 13, 2024
1 parent 2cbb60a commit 88c224c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion py_gd/py_gd.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ cdef FILE* open_file(file_path) except *:
IF UNAME_SYSNAME == 'Windows':
cdef bytes bytes_flag = "wb".encode('utf-16')
cdef bytes bytes_filepath = file_path.encode('utf-16')
fp = _wfopen(<wchar_t*> bytes_filepath, <wchar_t*> bytes_flag)
fp = _wfopen(<wchar_t*><char*>bytes_filepath, <wchar_t*><char*>bytes_flag)
ELSE:
cdef bytes bytes_flag = "wb".encode('ascii')
fp = fopen(file_path.encode('utf-8'), bytes_flag)
Expand Down

0 comments on commit 88c224c

Please sign in to comment.