TypeError with malformed playlists
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zeya |
New
|
Undecided
|
Unassigned |
Bug Description
Some of my playlists were malformed (ie they did not conform to the spec), and zeya tried to interpret some of its garbage data. Unfortunately it doesn't check for filename correctness, and the os.stat call fails with this error:
```
TypeError: must be encoded string without NULL bytes, not str
```
Here's an easy fix:
```
diff --git a/directory.py b/directory.py
index 069f222..d47fa94 100644
--- a/directory.py
+++ b/directory.py
@@ -134,6 +134,8 @@ class DirectoryBacken
# previous_db acts as a cache of mtime and metadata, keyed by
# filename.
+ if (u'\0' in filename):
+ raise ValueError
if rec_mtime is not None and rec_mtime >= file_mtime:
```