torproject / stem

Python controller library for Tor
https://stem.torproject.org/
GNU Lesser General Public License v3.0
260 stars 75 forks source link

Fix linux_distribution call in python3.8 #15

Closed Gu1nness closed 5 years ago

Gu1nness commented 5 years ago

In Python3.8, the method platform.linux_distribution is deprecated and removed. The alternative is to use the module distro, which has been built to replace this function.

This commit adds the module in the requirements and changes the call.

teor2345 commented 5 years ago

All the CI failures are unrelated controller hangs. We're working on them in other tickets.

atagar commented 5 years ago

Hi Gu1nness, thank you for your pull request! Our linux_distribution() call is only used for display purposes. I'd prefer if test/task.py simply omits that bit of information when linux_distribution() is unavailable rather than add a new dependency.

Thanks!

Gu1nness commented 5 years ago

Ok sure! I'll change this with a try/catch then. However, since it will disappear starting from python3.8 this means that this bit of information will eventually disappear when the support of older python version is dropped. Then we should remind to remove this at this moment, or find another way to display it (without extra dependencies)

atagar commented 5 years ago

Thanks! And agreed, at some point we'll need to drop it. Feel free to include a todo comment (something like "# TODO: remove this when we drop python 3.7 support"?).

teor2345 commented 5 years ago

Fixed in af52d8b