Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding bug of windows 10, python3 with eyed3 0.8.5 #165

Closed
LipsonX opened this issue May 16, 2018 · 3 comments
Closed

encoding bug of windows 10, python3 with eyed3 0.8.5 #165

LipsonX opened this issue May 16, 2018 · 3 comments

Comments

@LipsonX
Copy link

LipsonX commented May 16, 2018

I found it does work in python3, win10 with eyed3 0.8.5. it can not open a offending filename like '1호선 뮤직 - 열대야.mp3'. all that is because the code for open a file with encode('utf8') in magic.py. And i have fix that. you can check pull request.

  • fix encoding bug of windows, maybe it is in only python3 sometimes
@ahupp
Copy link
Owner

ahupp commented May 7, 2020

Can you give more details of how to reproduce this?

@yyamano
Copy link

yyamano commented Mar 31, 2023

I can reproduce it as below with:

python: 3.10
python-magic: 0.4.27
python-magic-bin: 0.4.14
OS: Windows 10

C:\Users\yyamano\work\poc>dir *.xlsm
 ドライブ C のボリューム ラベルがありません。
 ボリューム シリアル番号は A864-D280 です

 C:\Users\yyamano\work\poc のディレクトリ

2023/03/24  10:00       102,100,573 20230310_01.xlsm
2023/03/24  10:00       102,100,573 日本語.xlsm
               2 個のファイル         204,201,146 バイト
               0 個のディレクトリ  350,047,604,736 バイトの空き領域

C:\Users\yyamano\work\poc>poetry run python poc-magic.py 20230310_01.xlsm 日本語.xlsm
File: 20230310_01.xlsm
        Microsoft Excel 2007+
File: 日本語.xlsm
        cannot open `\346\227\245\346\234\254\350\252\236.xlsm' (Illegal byte sequence)

C:\Users\yyamano\work\poc>type poc-magic.py
import magic
import sys

if __name__ == "__main__":
    for file in sys.argv[1:]:
        print(f"File: {file}")
        print("\t" + magic.magic.from_file(file))

@ahupp
Copy link
Owner

ahupp commented Aug 25, 2023

Merging into #287

@ahupp ahupp closed this as completed Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants