Git Product home page Git Product logo

Comments (10)

littlecodersh avatar littlecodersh commented on May 29, 2024

@xzjs 这是因为在nohup当中无法读取到系统命令行的默认字符集
把out.py的11-12行改为下面的内容就可以了:

sys.stdout.write(msg.encode(sys.stdin.encoding or 'utf8', 'replace'
    ).decode(sys.stdin.encoding or 'utf8', 'replace'))

我会在下一个版本中修复进去

from itchat.

xzjs avatar xzjs commented on May 29, 2024

@littlecodersh pull了最新的代码,现在二维码都没法生成了,只有我一个这样么

Getting QR Code
Failed to get QR Code, please restart the program

from itchat.

littlecodersh avatar littlecodersh commented on May 29, 2024

@xzjs 试试看把86-101行的异常输出出来,看下是什么问题:

def get_QR(self, uuid = None, enableCmdQR = False):
    try:
        if uuid == None: uuid = self.uuid
        url = '%s/qrcode/%s'%(BASE_URL, uuid)
        r = self.s.get(url, stream = True)
        QR_DIR = 'QR.jpg'
        with open(QR_DIR, 'wb') as f: f.write(r.content)
        if enableCmdQR:
            tools.print_cmd_qr(QR_DIR)
        else:
            tools.print_qr(QR_DIR)
        return True
    except:
        import traceback
        traceback.print_exc()
        return False

from itchat.

tempdban avatar tempdban commented on May 29, 2024

我觉得是路径问题吧,可能当前路径没写权限

from itchat.

xzjs avatar xzjs commented on May 29, 2024

@littlecodersh 抛出的异常时这个
`Getting QR CodeTraceback (most recent call last):
File "/Users/xzjs/Desktop/CodeComplete/python/ItChat/itchat/client.py", line 96, in get_QR
tools.print_qr(QR_DIR)
File "/Users/xzjs/Desktop/CodeComplete/python/ItChat/itchat/tools.py", line 49, in print_qr

subprocess.call(['open', fileDir])

NameError: global name 'subprocess' is not defined`

from itchat.

xzjs avatar xzjs commented on May 29, 2024

忘了说了,我的开发环境是mac,部署环境是centos 7

from itchat.

tempdban avatar tempdban commented on May 29, 2024

@xzjs 临时解决方案:
在/Users/xzjs/Desktop/CodeComplete/python/ItChat/itchat/tools.py
最上面加一行:
import subprocess

from itchat.

xzjs avatar xzjs commented on May 29, 2024

@tempdban 解决了,太感谢了

from itchat.

tempdban avatar tempdban commented on May 29, 2024

坐等老大修复

from itchat.

littlecodersh avatar littlecodersh commented on May 29, 2024

@tempdban 都是码代码的兄弟 😁

from itchat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.