Bug#418108: python-central: UnboundLocalError: local variable 'config' referenced before assignment

2007-04-10 Thread Matthias Klose
Steve Langasek writes:
 Hi Matthias,
 
 Well, this one-line bug is causing us quite a bit of trouble in unstable
 right now, so I've prepared a 0-day NMU to fix it on the grounds that it
 would be nice to not have all new python package uploads failing to build on
 the buildds.  Patch attached, NMU on its way to incoming.

thanks for addressing this; sorry, uploaded an unfixed version :-(

  Matthias


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#418108: Fwd: Bug#418108: python-central: UnboundLocalError: local variable 'config' referenced before assignment

2007-04-07 Thread Wesley J. Landaker
tag 418108 patch
thanks

Forwarding to the bug tracker... thanks!

--  Forwarded Message  --

Subject: Bug#418108: python-central: UnboundLocalError: local 
variable 'config' referenced before assignment
Date: Saturday 07 April 2007 08:04
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

Mr. Landaker,

I am not registered with the debian bugs list, but I think that I found a
 fix for the below referenced bug if you want to relay that to the package
 maintainers:

Wesley J. Landaker wrote:
 Package: python-central
 Version: 0.5.13
 Severity: serious

 Trying to upgrade fails. Trying to rerun looks like this:

 # dpkg --configure -a
 Setting up python2.4-minimal (2.4.4-3) ...
 Linking and byte-compiling packages for runtime python2.4...
 Traceback (most recent call last):
   File /usr/bin/pycentral, line 1373, in ?
 main()
   File /usr/bin/pycentral, line 1363, in main
 if action.check_args(global_options):
   File /usr/bin/pycentral, line 971, in check_args
 for rt in get_installed_runtimes():
   File /usr/bin/pycentral, line 196, in get_installed_runtimes
 supported = pyversions.supported_versions()
   File /usr/share/pycentral-data/pyversions.py, line 98, in
 supported_versions
 value = read_default('supported-versions')
   File /usr/share/pycentral-data/pyversions.py, line 22, in
 read_default value = config.get('DEFAULT', name)
 UnboundLocalError: local variable 'config' referenced before assignment

Quoted from:
http://www.nabble.com/Bug-418108%3A-python-central%3A-UnboundLocalError%3A-
local-variable-%27config%27-referenced-before-assignment-tf3539046.html#a98
79270

The following patch should work:

--- pyversions.py   2007-04-07 09:58:05.0 -0400
+++ pyversions-fixed.py 2007-04-07 09:58:42.0 -0400
@@ -19,7 +19,7 @@
 _defaults = config
 if _defaults and name:
 try:
-value = config.get('DEFAULT', name)
+value = _defaults.get('DEFAULT', name)
 except NoOptionError:
 raise ValueError
 return value

The problem is that a previous invocation of read_default set the global
 variable `_defaults' which caused the second invocation of read_default to
 bypass the setting of the local variable `config'.  Clearly the intent was
 for the global `_defaults' to hold a reference to the `config' object
 generated in the original run, but somehow the local `config' was used
 instead.

Regards,

Ryan Van Wagoner

---

-- 
Wesley J. Landaker [EMAIL PROTECTED] xmpp:[EMAIL PROTECTED]
OpenPGP FP: 4135 2A3B 4726 ACC5 9094  0097 F0A9 8A4C 4CD6 E3D2


pgpbF0LseXiQa.pgp
Description: PGP signature


Bug#418108: python-central: UnboundLocalError: local variable 'config' referenced before assignment

2007-04-07 Thread Steve Langasek
Hi Matthias,

Well, this one-line bug is causing us quite a bit of trouble in unstable
right now, so I've prepared a 0-day NMU to fix it on the grounds that it
would be nice to not have all new python package uploads failing to build on
the buildds.  Patch attached, NMU on its way to incoming.

Thanks,
-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
[EMAIL PROTECTED]   http://www.debian.org/
diff -Nru /tmp/zLS1d6oeV9/python-central-0.5.13/debian/changelog /tmp/LiN9F8kwmp/python-central-0.5.13/debian/changelog
--- /tmp/zLS1d6oeV9/python-central-0.5.13/debian/changelog	2007-04-06 09:09:31.0 -0700
+++ /tmp/LiN9F8kwmp/python-central-0.5.13/debian/changelog	2007-04-07 13:18:59.0 -0700
@@ -1,3 +1,13 @@
+python-central (0.5.13-0.1) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * High-urgency upload to unbreak all of python in unstable to make the
+bug reports stop flooding my inbox
+  * Fix a wrong variable name in read_default that was breaking all use
+of pyversions.py.  Closes: #418108.
+
+ -- Steve Langasek [EMAIL PROTECTED]  Sat, 07 Apr 2007 13:04:11 -0700
+
 python-central (0.5.13) unstable; urgency=high
 
   * Add a sanity check, that /usr/bin/python points to the default
diff -Nru /tmp/zLS1d6oeV9/python-central-0.5.13/pyversions.py /tmp/LiN9F8kwmp/python-central-0.5.13/pyversions.py
--- /tmp/zLS1d6oeV9/python-central-0.5.13/pyversions.py	2007-04-06 09:06:09.0 -0700
+++ /tmp/LiN9F8kwmp/python-central-0.5.13/pyversions.py	2007-04-07 13:04:09.0 -0700
@@ -19,7 +19,7 @@
 _defaults = config
 if _defaults and name:
 try:
-value = config.get('DEFAULT', name)
+value = _defaults.get('DEFAULT', name)
 except NoOptionError:
 raise ValueError
 return value


Bug#418108: python-central: UnboundLocalError: local variable 'config' referenced before assignment

2007-04-06 Thread Wesley J. Landaker
Package: python-central
Version: 0.5.13
Severity: serious

Trying to upgrade fails. Trying to rerun looks like this:

# dpkg --configure -a
Setting up python2.4-minimal (2.4.4-3) ...
Linking and byte-compiling packages for runtime python2.4...
Traceback (most recent call last):
  File /usr/bin/pycentral, line 1373, in ?
main()
  File /usr/bin/pycentral, line 1363, in main
if action.check_args(global_options):
  File /usr/bin/pycentral, line 971, in check_args
for rt in get_installed_runtimes():
  File /usr/bin/pycentral, line 196, in get_installed_runtimes
supported = pyversions.supported_versions()
  File /usr/share/pycentral-data/pyversions.py, line 98, in supported_versions
value = read_default('supported-versions')
  File /usr/share/pycentral-data/pyversions.py, line 22, in read_default
value = config.get('DEFAULT', name)
UnboundLocalError: local variable 'config' referenced before assignment
dpkg: error processing python2.4-minimal (--configure):
 subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python2.4:
 python2.4 depends on python2.4-minimal (= 2.4.4-3); however:
  Package python2.4-minimal is not configured yet.
dpkg: error processing python2.4 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of blender:
 blender depends on python2.4 (= 2.3.90); however:
  Package python2.4 is not configured yet.
dpkg: error processing blender (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python2.4-minimal
 python2.4
 blender


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (40, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-3-k7
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages python-central depends on:
ii  python2.4.4-2An interactive high-level object-o

python-central recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]