scriptutils.py::_iter_source_paragraphs selects the decompression algorithm non-deterministically

Bug #1801720 reported by Robie Basak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-ubuntu
Triaged
Low
Unassigned

Bug Description

I just noticed this:

    compressions = {
        '.xz': lzma.decompress,
        '.bz2': bz2.decompress,
        '.gz': gzip.decompress,
    }
    [...]
    for compression, decompresser in compressions.items():

We should probably use an OrderedDict and decide what order to try decompressing in. This shouldn't cause a functional problem currently in theory, but it would be helpful to be deterministic in case of an unrelated bug or problem.

Revision history for this message
Nish Aravamudan (nacc) wrote : Re: [Bug 1801720] [NEW] scriptutils.py::_iter_source_paragraphs selects the decompression algorithm non-deterministically

Ack, I don't think a given tarball can be decompressed by more than one of
these, but for determinism I'm fine with ordering it.

On Mon, Nov 5, 2018, 5:55 AM Robie Basak <<email address hidden> wrote:

> Public bug reported:
>
> I just noticed this:
>
> compressions = {
> '.xz': lzma.decompress,
> '.bz2': bz2.decompress,
> '.gz': gzip.decompress,
> }
> [...]
> for compression, decompresser in compressions.items():
>
> We should probably use an OrderedDict and decide what order to try
> decompressing in. This shouldn't cause a functional problem currently in
> theory, but it would be helpful to be deterministic in case of an
> unrelated bug or problem.
>
> ** Affects: usd-importer
> Importance: Low
> Status: Triaged
>
> --
> You received this bug notification because you are a member of Ubuntu
> Server Dev import team, which is subscribed to usd-importer.
> https://bugs.launchpad.net/bugs/1801720
>
> Title:
> scriptutils.py::_iter_source_paragraphs selects the decompression
> algorithm non-deterministically
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/usd-importer/+bug/1801720/+subscriptions
>
> Launchpad-Notification-Type: bug
> Launchpad-Bug: product=usd-importer; status=Triaged; importance=Low;
> assignee=None;
> Launchpad-Bug-Information-Type: Public
> Launchpad-Bug-Private: no
> Launchpad-Bug-Security-Vulnerability: no
> Launchpad-Bug-Commenters: racb
> Launchpad-Bug-Reporter: Robie Basak (racb)
> Launchpad-Bug-Modifier: Robie Basak (racb)
> Launchpad-Message-Rationale: Subscriber (usd-importer) @usd-import-team
> Launchpad-Message-For: usd-import-team
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.