Message73659
| Author |
zooko |
| Recipients |
benjamin.peterson, bgomes, christian.heimes, draghuram, georg.brandl, lemburg, pavel.vinogradov, sapetnioc, zooko |
| Date |
2008年09月23日.19:38:19 |
| SpamBayes Score |
8.606287e-09 |
| Marked as misclassified |
No |
| Message-id |
<1222198700.72.0.995245083788.issue1322@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Okay, per MAL's request over on #3937, I tried
platform.get_linux_distribution() on the current svn trunk (which I
assume is the version that is about to become python 2.6). It gave the
same not-so-great answer as platform.dist() used to: ('debian',
'lenny/sid', ''). I then ported my patch to trunk (attached), and it
gave the answer I wanted: ('Ubuntu', '8.04', 'hardy').
Note that technique of parsing /etc/lsb-release or invoking lsb_release
is more standard and generic and easier to maintain than the current
technique of trying a series of specific file parses for specific
"supported" distributions. For example, if some new Linux distribution
is invented, or if this is tried on a distribution that isn't in the
supported list (has anyone tried this on Foresight Linux yet?), then my
technique has a good chance of working on that distribution, where the
current technique has a higher chance of accidentally mis-identifying it
as some other distribution, for example the way that the current trunk
mis-identifies Ubuntu 8.04 as Debian lenny/sid. |
|