ParseSection(control).get(field, default) raises when default is None
Bug #44470 reported by
Robert Collins
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-apt (Ubuntu) |
Fix Released
|
Medium
|
Michael Vogt |
Bug Description
A common idiom in python is to be able to do:
dictionary.get(key, default)
default here is often None, or some sensible default. python-apt is confusing because a default of None raises, and this means that clients cannot as easily discriminate between an empty control field and a missing one.
Changed in python-apt: | |
assignee: | nobody → mvo |
status: | New → Fix Committed |
To post a comment you must log in.
python-apt (0.7.4ubuntu1) hardy; urgency=low
* merged from debian/unstable, remaining changes:
- rebuild against latest apt
- maintainer field changed
python-apt (0.7.4) unstable; urgency=low
* apt/debfile.py: debExtract( ) Dependency. relation initialization apt_instmodule. cc: distro. py: eException if not distribution template metaindex. cc: sourceslist. cc: ion(control) .get(field, default), LP: #44470
- added wrapper around apt_inst.
- support dictionary like access
* apt/package.py:
- fix apt.package.
* python/
- added arCheckMember()
- fix typo
* aptsources/
- throw NoDistroTemplat
can be found
* python/string.cc:
- fix overflow in SizeToStr()
* python/
- added support for the metaIndex objects
* python/
- support new "List" attribute that returns the list of
metaIndex source entries
* python/depcache.cc:
- be more threading friendly
* python/tag.cc
- support "None" as default in
ParseSect
* python/progress.cc:
- fix refcount problem in OpProgress
- fix refcount problem in FetchProgress
- fix refcount problem in CdromProgress
* apt/README.apt:
- fix typo (thanks to Thomas Schoepf, closes: #387787)
* po/fr.po:
- merge update, thanks to Christian Perrier (closes: #435918)
* data/templates/:
- update templates
-- Michael Vogt <email address hidden> Thu, 13 Dec 2007 15:00:22 +0100