This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年05月10日 23:14 by nick.wilson, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| bad_version_number_with_name.patch | sigi, 2012年05月14日 20:39 | review | ||
| Messages (8) | |||
|---|---|---|---|
| msg160381 - (view) | Author: Nick Wilson (nick.wilson) * | Date: 2012年05月10日 23:14 | |
IrrationalVersionError in packaging/distutils2 should include the name of the project responsible for the error. It currently only includes the version:
>>> import packaging.pypi.xmlrpc
>>> client = packaging.pypi.xmlrpc.Client()
>>> client.search_projects('req')
Irrational version error found: 0.0.0-prealpha
Irrational version error found: 0.1dev-20110502
...
|
|||
| msg160383 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2012年05月10日 23:40 | |
Setting to easy for the next sprints. To do: add an argument to the IrrationalVersion constructor, add a test to make sure the result of __str__ includes it, and adapt the rest of the codebase to pass the project name when the exception is raised. |
|||
| msg160630 - (view) | Author: Christoph Echtinger-Sieghart (sigi) * | Date: 2012年05月14日 15:52 | |
I took a look at the code and I don't think that adding an argument to the IrrationalVersionError constructor is the right way to go. The exception is raised in places where we don't know for which project we are raising the exception (eg in packaging.version.NormalizedVersion). Wouldn't it be better to make packaging.pypi.xmlrpc.Client just print the package name with the exception? I would be glad to contribute a patch. |
|||
| msg160632 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2012年05月14日 16:11 | |
You are right. When the NormalizedVersion class is used standalone, there is no project name to pass, so it is the responsibility of higher-level code (the Metadata class I think here) to raise or log messages including the project name. To make a patch, you can use the hg.python.org/distutils2 repo (also mirrored on Bitbucket under the python_mirrors user account for easing cloning) or the CPython repository. Thanks! |
|||
| msg160634 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2012年05月14日 16:12 | |
BTW there could be an optional argument in the exception constructor for the project name, but that does not seem clean to me. |
|||
| msg160659 - (view) | Author: Christoph Echtinger-Sieghart (sigi) * | Date: 2012年05月14日 19:55 | |
The optional argument approach doesn't seem clean to me either. I think the correct approach is - as you wrote - to change the higher level code to include the project name in the exception message. |
|||
| msg160665 - (view) | Author: Christoph Echtinger-Sieghart (sigi) * | Date: 2012年05月14日 20:38 | |
I wrote a trivial patch against the CPython repository that adds the name to the exception message. Did I forget anything? What kind of test would make sense? |
|||
| msg213245 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2014年03月12日 10:41 | |
distutils2 development has stopped. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:30 | admin | set | github: 58983 |
| 2014年03月12日 10:41:59 | eric.araujo | set | status: open -> closed resolution: out of date messages: + msg213245 stage: needs patch -> resolved |
| 2012年05月14日 20:39:42 | sigi | set | files: + bad_version_number_with_name.patch |
| 2012年05月14日 20:39:01 | sigi | set | files: - bad_version_number_with_name.patch |
| 2012年05月14日 20:38:44 | sigi | set | files:
+ bad_version_number_with_name.patch keywords: + patch messages: + msg160665 |
| 2012年05月14日 19:55:35 | sigi | set | messages: + msg160659 |
| 2012年05月14日 16:12:26 | eric.araujo | set | messages:
+ msg160634 title: IrrationalVersionError should include the project name -> logging messages about bad version numbers should include the project name |
| 2012年05月14日 16:11:16 | eric.araujo | set | messages:
+ msg160632 stage: needs patch |
| 2012年05月14日 15:52:41 | sigi | set | nosy:
+ sigi messages: + msg160630 |
| 2012年05月10日 23:40:46 | eric.araujo | set | keywords:
+ easy messages: + msg160383 |
| 2012年05月10日 23:14:00 | nick.wilson | create | |