[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#853238: marked as done (Bug on python3-apt)



Your message dated Mon, 30 Jan 2017 22:07:03 +0100
with message-id <20170130215937.GA4006@debian.org>
and subject line Re: Bug#853238: Bug on python3-apt
has caused the Debian Bug report #853238,
regarding Bug on python3-apt
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
853238: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853238
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: python3-apt
Severity: important

--- Please enter the report below this line. ---


When using `apt.cache.Cache.update()` with specifying a sourcelist file,
two errors happen:
- On one hand, because of a return inside the `try` block,  `finally`
    is not executed sometimes.
- When executing finally, apt_pkg settings are rolled back, so `open`
    function reverts the new sources when the new `Cache` instance is
    created, updating again without the parameters set.

It's important to say that I found the same bug on python3-apt 1.4~beta4 (sid) and 0.9.3.12 (stable)

Patch:

@@ -454,6 +454,8 @@
         else:
             slist = self._list

+        res = None
+
         try:
             if fetch_progress is None:
                 fetch_progress = apt.progress.base.AcquireProgress()
@@ -462,17 +464,19 @@
                                          pulse_interval)
             except SystemError as e:
                 raise FetchFailedException(e)
-            if not res and raise_on_error:
-                raise FetchFailedException()
-            else:
-                return res
         finally:
+            self.open()
             os.close(lock)
             if sources_list:
                 apt_pkg.config.set("Dir::Etc::sourcelist", old_sources_list)
                 apt_pkg.config.set("Dir::Etc::sourceparts", old_sources_list_d)
                 apt_pkg.config.set("APT::List-Cleanup", old_cleanup)

+        if not res and raise_on_error:
+            raise FetchFailedException()
+        else:
+            return res
+

--- System information. ---
Architecture:
Kernel:       Linux 4.8.0-0.bpo.2-amd64

Debian Release: 9.0
  500 unstable        ftp.ccc.uba.ar
  500 unstable        dl.winehq.org
  500 stable-updates  ftp.ccc.uba.ar
  500 stable          security.debian.org
  500 stable          repository.spotify.com
  500 stable          ftp.ccc.uba.ar
  500 stable          dl.google.com
  500 debian-stretch  apt.dockerproject.org
  100 jessie-backports ftp.ccc.uba.ar

--- Package information. ---
Depends                    (Version) | Installed
====================================-+-===============
python3                     (<< 3.6) | 3.5.1-4
python3                    (>= 3.5~) | 3.5.1-4
python3:any            (>= 3.3.2-2~) |
libapt-inst2.0        (>= 1.4~beta3) | 1.4~beta4
libapt-pkg5.0         (>= 1.4~beta3) | 1.4~beta4
libc6                      (>= 2.14) |
libgcc1                   (>= 1:3.0) |
libstdc++6                  (>= 5.2) |
python-apt-common                    |


Recommends       (Version) | Installed
==========================-+-===========
lsb-release                | 4.1+Debian13+nmu1
iso-codes                  | 3.74-1


Suggests             (Version) | Installed
==============================-+-===========
python3-apt-dbg                |
python-apt-doc                 |
apt                            | 1.4~beta4




__
Martin Iñaki Malerba
inakimmalerba@gmail.com | +54 02945 15468443


--- End Message ---
--- Begin Message ---
On Mon, Jan 30, 2017 at 03:46:00PM -0300, Iñaki Malerba wrote:
> Package: python3-apt
> Severity: important
> 
> --- Please enter the report below this line. ---
> 
> 
> When using `apt.cache.Cache.update()` with specifying a sourcelist file,
> two errors happen:
> - On one hand, because of a return inside the `try` block,  `finally`
>     is not executed sometimes.

You lost me here. A finally clause is *always* executed, no matter you
leave the try clause.

> - When executing finally, apt_pkg settings are rolled back, so `open`
>     function reverts the new sources when the new `Cache` instance is
>     created, updating again without the parameters set.

You can specify a *temporary* sources.list to update only a subset of
your packages files in a complete cache. Not to switch your sources.list
-- if you want to do that, set one manually.


> 
> It's important to say that I found the same bug on python3-apt 1.4~beta4
> (sid) and 0.9.3.12 (stable)
> 
> Patch:
> 
> @@ -454,6 +454,8 @@
>          else:
>              slist = self._list
> 
> +        res = None
> +
>          try:
>              if fetch_progress is None:
>                  fetch_progress = apt.progress.base.AcquireProgress()
> @@ -462,17 +464,19 @@
>                                           pulse_interval)
>              except SystemError as e:
>                  raise FetchFailedException(e)
> -            if not res and raise_on_error:
> -                raise FetchFailedException()
> -            else:
> -                return res
>          finally:
> +            self.open()

This is an update command, not an update and reopen. And that's
the only real change in here, moving the block around does not
change anything, as explained before.

So I'm closing this bug.

-- 
Debian Developer - deb.li/jak | jak-linux.org - free software dev
                  |  Ubuntu Core Developer |
When replying, only quote what is necessary, and write each reply
directly below the part(s) it pertains to ('inline').  Thank you.

--- End Message ---

Reply to: