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

[upstream?] DirectWrite: CreateFontFaceFromHDC() failed #28

Open
inkydragon opened this issue Jan 8, 2019 · 0 comments
Open

[upstream?] DirectWrite: CreateFontFaceFromHDC() failed #28

inkydragon opened this issue Jan 8, 2019 · 0 comments

Comments

@inkydragon
Copy link

ref: #8 (comment)
以上问题的复现。配置好 venv 后运行程序就会在终端输出错误信息,log 里没有,看上去应该是 QT的报错。

重现步骤

  1. 配置虚拟环境(直接装全局的应该一样)
# pip install virtualenv

virtualenv venv # 默认用了系统级 py3.6-32 的解释器
# pip install -r requirements.txt
pip install -r .\requirements.txt
  1. 激活虚拟环境
# source venv/bin/activate # *nix 系
.\venv\Scripts\activate
  1. 运行程序
    python .\MusicPlayer\music.py

通过 Pychram 运行也一样

  1. 就看到了Bug。
    终端输出
DirectWrite: CreateFontFaceFromHDC() failed (???????????? (????????????) ??????????) for QFontDef(Family="System", pointsize=16, pixelsize=20, styleHint=5, weight=9, stretch=100, hintingPreference=0) LOGFONT("System", lfWidth=0, lfHeight=-20) dpi=168

如果不发生Bug

不该有报错

相关截图,日志

image

关闭程序后

终端输出
(venv) PS C:\Users\woclass\Desktop\GitHub\MusicBox> python .\MusicPlayer\music.py
DirectWrite: CreateFontFaceFromHDC() failed (???????????? (????????????) ??????????) for QFontDef(Family="System", pointsize=16, pixelsize=20, styleHint=5, weight=9, stretch=100, hintingPreference=0) LOGFONT("System", lfWidth=0, lfHeight=-20) dpi=168
Exception ignored in: <bound method DbManager.__del__ of <userInfoManager.UserDbManager object at 0x04A7E490>>
Traceback (most recent call last):
  File "C:\Users\woclass\Desktop\GitHub\MusicBox\MusicPlayer\dbManager\dbManager.py", line 20, in __del__
    self.db.commit()
sqlite3.ProgrammingError: Cannot operate on a closed database.

(venv) PS C:\Users\woclass\Desktop\GitHub\MusicBox>
日志
INFO music  70 当前图片缓存目录: C:\Users\woclass\Desktop\GitHub\MusicBox\MusicPlayer\cache
INFO configDownloadFrameFeatures  82 下载目标变更C:\Users\woclass\Desktop\GitHub\MusicBox\MusicPlayer\downloads
INFO configDownloadFrameFeatures  82 下载目标变更C:\Users\woclass\Desktop\GitHub\MusicBox\MusicPlayer\downloads
INFO netEaseApi  56 进行网易云Url请求, args: ('http://music.163.com/api/playlist/list?cat=%E5%85%A8%E9%83%A8%E6%AD%8C%E5%8D%95&type=all&order=all&offset=0&total=true&limit=30&index=1',), kwargs: {'method': 'GET', 'cookies': {'appver': '2.1.2.184499', 'os': 'pc', 'channel': 'netease'}}
ERROR __init__  589 Task exception was never retrieved
future: <Task finished coro=<setUserData() done, defined at C:\Users\woclass\Desktop\GitHub\MusicBox\MusicPlayer\features\configMainFeatures.py:239> exception=KeyError('profile',)>
Traceback (most recent call last):
  File "C:\Users\woclass\Desktop\GitHub\MusicBox\MusicPlayer\features\configMainFeatures.py", line 241, in setUserData
    profile = self.loginInfor['profile']
KeyError: 'profile'
INFO xiamiApi  55 进行xiami Url请求, args: ('http://api.xiami.com/web?v=2.0&app_key=1&_ksTS=1459927525542_91&page=1&limit=30&callback=jsonp92&r=collect/recommend',), kwargs: {'method': 'GET'}
INFO qqApi  43 进行QQ Url请求, args: ('https://c.y.qq.com/splcloud/fcgi-bin/fcg_get_diss_by_tag.fcg?rnd=0.5136307078685405&g_tk=5381&jsonpCallback=getPlaylist&loginUin=0&hostUin=0&format=jsonp&inCharset=utf8&outCharset=utf-8&notice=0&platform=yqq&needNewCode=0&categoryId=10000000&sortId=5&sin=30&ein=29',), kwargs: {'method': 'GET', 'headers': {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'Accept-Encoding': 'gzip,deflate,sdch', 'Accept-Language': 'zh-CN,zh;q=0.8', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36', 'Host': 'c.y.qq.com', 'Referer': 'https://y.qq.com/portal/playlist.html'}}
ERROR music  539 got some error
Traceback (most recent call last):
  File ".\MusicPlayer\music.py", line 537, in start
SystemExit: 0

系统信息

系统信息
  • OS:
    • win 10 - 1809 - 17763.1953
    • x64
  • pip list
(venv) C:\Users\woclass\Desktop\GitHub\MusicBox>pip list
Package      Version
------------ ----------
certifi      2018.11.29
chardet      3.0.4
eyeD3        0.8
idna         2.8
pip          10.0.1
pycryptodome 3.7.2
PyQt5        5.11.3
PyQt5-sip    4.19.13
Quamash      0.6.1
requests     2.21.0
setuptools   39.1.0
six          1.12.0
urllib3      1.24.1
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
  • python
(venv) C:\Users\woclass\Desktop\GitHub\MusicBox>python
Python 3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 12:45:02) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

其他

google 到的相关问题:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants