summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/metadata.py
diff options
context:
space:
mode:
authorTarek Ziade <tarek@ziade.org>2011-05-30 10:25:38 (GMT)
committerTarek Ziade <tarek@ziade.org>2011-05-30 10:25:38 (GMT)
commitb9c09878ab8390aa9b78ff468f42ed91bae2b1fe (patch)
tree5f7a3104defc2a81f26d40c64034a1a23e24f92e /Lib/packaging/metadata.py
parent2da756592bb7b89e93c8cf2f7ab11a8eb27268fc (diff)
downloadcpython-b9c09878ab8390aa9b78ff468f42ed91bae2b1fe.zip
cpython-b9c09878ab8390aa9b78ff468f42ed91bae2b1fe.tar.gz
cpython-b9c09878ab8390aa9b78ff468f42ed91bae2b1fe.tar.bz2
displaying the faulty project name is a good idea
Diffstat (limited to 'Lib/packaging/metadata.py')
-rw-r--r--Lib/packaging/metadata.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/Lib/packaging/metadata.py b/Lib/packaging/metadata.py
index 596eec7..53d91f7 100644
--- a/Lib/packaging/metadata.py
+++ b/Lib/packaging/metadata.py
@@ -396,22 +396,24 @@ class Metadata:
value = []
if logger.isEnabledFor(logging.WARNING):
+ project_name = self['Name']
+
if name in _PREDICATE_FIELDS and value is not None:
for v in value:
# check that the values are valid predicates
if not is_valid_predicate(v.split(';')[0]):
logger.warning(
- '%r is not a valid predicate (field %r)',
- v, name)
+ '%r: %r is not a valid predicate (field %r)',
+ project_name, v, name)
# FIXME this rejects UNKNOWN, is that right?
elif name in _VERSIONS_FIELDS and value is not None:
if not is_valid_versions(value):
- logger.warning('%r is not a valid version (field %r)',
- value, name)
+ logger.warning('%r: %r is not a valid version (field %r)',
+ project_name, value, name)
elif name in _VERSION_FIELDS and value is not None:
if not is_valid_version(value):
- logger.warning('%r is not a valid version (field %r)',
- value, name)
+ logger.warning('%r: %r is not a valid version (field %r)',
+ project_name, value, name)
if name in _UNICODEFIELDS:
if name == 'Description':