推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
guiqiqi
V2EX  ›  Python

修复 WordPress 站点迁移后中文名附件无法显示问题的小工具

  •  
  •   guiqiqi · Mar 25, 2018 · 2281 views
    This topic created in 3061 days ago, the information mentioned may be changed or developed.

    在上一片帖子中,我向 V 友们请教了如何解决压缩文档导致文件名编码错误,从而使 WordPress 中文名附件无法正常被加载的问题(当时我在站点迁移之后出现站内图片大量 404 的情况)。

    大家的建议都很好: 不应该使用中文附件名;压缩站点应该使用 tar 而不是 zip 等等,我受益匪浅。但站点图片 404 的问题一直都没能够解决。

    之后有一天在 Google 上找到一片文章( Git 上有原文链接,这里就不放了),通过修改文件名以及数据库中文件名记录来修复这个问题。作者也提供了一个工具,但是很遗憾,我试了 4 台电脑,都没能成功运行(运行中出错)。

    于是今天闲下来就用 Python 重写了一遍这个工具,并且发到了 Git 上。希望对大家能有用。同时也感谢原作者 WP 大学的 @木子 提供的思路。

    Github 地址: https://github.com/guiqiqi/WPChineseAttachFix

    祝大家使用愉快 O(∩_∩)O~~

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1093 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 23:07 · PVG 07:07 · LAX 16:07 · JFK 19:07
    ♥ Do have faith in what you're doing.