Closed Bug 1772578 Opened 2 years ago Closed 2 years ago

TypeError in updater

Categories

(Conduit :: moz-phab, defect)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Kwan, Assigned: Kwan)

Details

Attachments

(1 file)

moz-phab will currently throw a TypeError while trying to raise a friendly error if it detects the current python version is too out of date to install the latest version of moz-phab on pypi. This is because it tries to call str.join() on a list of ints, which as documented isn't allowed:

A TypeError will be raised if there are any non-string values in iterable

https://github.com/mozilla-conduit/review/blob/82e1aef340382638d3e12544a5b0dcfe954a1637/mozphab/updater.py#L50

        # convert ">=3.6" to (3, 6)
        try:
            required_python_version = tuple(
                [int(i) for i in pypi_info["requires_python"][2:].split(".")]
            )
        except ValueError:
            required_python_version = ()

        if sys.version_info < required_python_version:
            raise Error(
                "Unable to upgrade to version {}.\n"
                "MozPhab requires Python in version >= {}".format(
                    pypi_info["version"], ".".join(required_python_version)
                )
            )

Rather than trying to call str.join() on a tuple of ints and throwing a
TypeError.

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: