[game-data-packager] 25/25: WantedFile.provides_files: initialize to empty set, not None
Simon McVittie
smcv at debian.org
Sat May 20 12:55:18 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian/stretch
in repository game-data-packager.
commit 3b813063ad2030dc1fa8d2f505b7d4bd4d19c694
Author: Simon McVittie <smcv at debian.org>
Date: Sun May 14 13:52:21 2017 +0100
WantedFile.provides_files: initialize to empty set, not None
Otherwise, iterating over them can lead to this error:
Traceback (most recent call last):
File "tools/check_syntax.py", line 26, in <module>
game.load_file_data()
File "game_data_packager/__init__.py", line 710, in load_file_data
for provided in f.provides_files:
TypeError: 'NoneType' object is not iterable
(cherry picked from commit 61bd889a7d62550e9aaa7e9512c1c1e3bf351d9f)
---
debian/changelog | 2 ++
game_data_packager/data.py | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 21915b3..e29a857 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,8 @@ game-data-packager (49.1) UNRELEASED; urgency=medium
(Closes: #862432) [smcv]
- Remove metadata pointing to the DotEmu online store, which has
now closed [adetiste]
+ - Fix a potential crash during data loading by initializing
+ WantedFile.provides_files correctly [smcv]
* Internal changes:
- debian/copyright.in: Update [smcv]
- debian/.gitignore: Update for game-data-packager-runtime [smcv]
diff --git a/game_data_packager/data.py b/game_data_packager/data.py
index 043832c..c24bf60 100644
--- a/game_data_packager/data.py
+++ b/game_data_packager/data.py
@@ -180,7 +180,7 @@ class WantedFile(HashedFile):
self.license = False
self._look_for = None
self._provides = set()
- self.provides_files = None
+ self.provides_files = set()
self._size = None
self.unpack = None
self.unsuitable = None
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git
More information about the Pkg-games-commits
mailing list