Closed dby124 closed 6 years ago
I have change "with open(self.filename, 'rtU') as f:" to "with open(self.filename, 'rt') as f:"
I suspect this error is related to universal newline mode which was deprecated in Python 3.X. However, based on your path you seem to be using Python 2.7?
Commit 6ec24e9114a54ee894dc8c8f8043b5fb87679a87 should make behaviour more robust across different versions of Python.
Yes, I am using Python 2.7. Maybe Python 2.7 also don't support universal newline mode.
Code was refactored to use io.open
method instead inbuilt open
in the commit 642f9aa04c329c007b7728358a4bb40ee75fe562 to get more robust behaviour across different Python versions.
Traceback (most recent call last): File "D:/py_code/firstpython/venv/first_python/test_file.py", line 25, in
db.initialize()
File "D:\learn_program\Python27\lib\site-packages\dcase_util\datasets\datasets.py", line 566, in initialize
self.load()
File "D:\learn_program\Python27\lib\site-packages\dcase_util\datasets\datasets.py", line 408, in load
self.load_meta()
File "D:\learn_program\Python27\lib\site-packages\dcase_util\datasets\datasets.py", line 421, in load_meta
self.meta_container.load()
File "D:\learn_program\Python27\lib\site-packages\dcase_util\containers\metadata.py", line 899, in load
with open(self.filename, 'rtU') as f:
ValueError: Invalid mode ('rbt')