python使用rrdtool时 argument 0 must be string的问题
2014-10-14 09:48
323 查看
在updatev rrdfile时,
报了argument 0 must be string的异常,经查是因为python 的rrdtool不是用unicode,而传递进来的参数使用了unicode,解决办法很简单
ret = rrdtool.updatev(filename, ds)
报了argument 0 must be string的异常,经查是因为python 的rrdtool不是用unicode,而传递进来的参数使用了unicode,解决办法很简单
ret = rrdtool.updatev(filename.encode(), ds.encode())
相关文章推荐
- python-rrdtool创建rrd文件的TypeError: argument 0 must be string 错误
- Python出现TypeError: file() argument 1 must be encoded string without NULL bytes, not str问题解决
- python32版本,出现问题“struct.error: argument for 's' must be a bytes object”的解决办法
- React 使用fromidable 模块进行文件上传出现First argument must be a string 的解析错误的原因
- python:PyInstaller打包发布单个文件错误struct.error: argument for 's' must be a string解决
- JMeter学习-027-JMeter参数文件(脚本分发)路径问题:jmeter.threads.JMeterThread: Test failed! java.lang.IllegalArgumentException: File distributed.csv must exist and be readable解决方法
- python错误:TypeError: string indices must be integers
- android L 出现的问题IllegalArgumentException: Service Intent must be explicit: Intent
- python2.7 使用super关键词 报错 TypeError: must be type, not classobj 解决办法
- A context path must either be an empty string or start with a '/' and do not end with a '/' 问题解决方法
- python2.7 使用super关键词 报错 TypeError: must be type, not&n
- BUG!!!======> syncdb 时 “ TypeError: decode() argument 1 must be string, not None ”
- 关于python2.7的md5加密遇到的问题(TypeError: Unicode-objects must be encoded before hashing)
- Bitmap.createBitmap java.lang.IllegalArgumentException: width and height must be > 0 问题解决
- 使用aidl隐式调用service出现service intent must be explicit 问题的一种解决方法
- 问题记录2:TypeError: write() argument must be str, not bytes
- 开发中碰到的问题:java.lang.IllegalArgumentException: quality must be 0..100
- Bitmap.createBitmap java.lang.IllegalArgumentException: width and height must be > 0 问题解决
- java.lang.IllegalArgumentException: x + width must be <= bitmap.width()问题
- int() argument must be a string or a number, not 'SimpleLazyObject'