Hi tjquk,
First of all, thank you for taking the time to review and maintain this project.
I found some issue while I trying to use _wmi_class's to_csv() function in python3.
1. TypeError: a bytes-like object is required, not 'str'
>>> system.Win32_ComputerSystem.to_csv()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\mason\fix-wmi\wmi\wmi.py", line 860, in to_csv
writer.writerow(fields)
TypeError: a bytes-like object is required, not 'str'
>>>
2. NameError: name 'unicode' is not defined
I delete _to_utf8() and open with encoding="utf-8"
>>> system.Win32_ComputerSystem.to_csv()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\mason\fix-wmi\wmi\wmi.py", line 862, in to_csv
writer.writerow([_to_utf8(getattr(instance, field)) for field in fields])
File "C:\Users\mason\fix-wmi\wmi\wmi.py", line 862, in <listcomp>
writer.writerow([_to_utf8(getattr(instance, field)) for field in fields])
File "C:\Users\mason\fix-wmi\wmi\wmi.py", line 851, in _to_utf8
if isinstance(item, unicode):
NameError: name 'unicode' is not defined
>>>
Hope you can take a review when you have time.
Thank you.
Hi tjquk, First of all, thank you for taking the time to review and maintain this project. I found some issue while I trying to use
_wmi_class's to_csv()
function in python3.1. TypeError: a bytes-like object is required, not 'str'
2. NameError: name 'unicode' is not defined
_to_utf8()
and open with encoding="utf-8"reference
Hope you can take a review when you have time. Thank you.
Warm regards, Mason