← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jelmer/launchpad-buildd/remove-seek_end-constant into lp:launchpad-buildd

 

Jelmer Vernooij has proposed merging lp:~jelmer/launchpad-buildd/remove-seek_end-constant into lp:launchpad-buildd.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #239213 in Launchpad Auto Build System: "Use os.SEEK_END when migrating to python2.5"
  https://bugs.launchpad.net/launchpad-buildd/+bug/239213

For more details, see:
https://code.launchpad.net/~jelmer/launchpad-buildd/remove-seek_end-constant/+merge/83771

Remove SEEK_END constant now that all build slaves run at least hardy.
-- 
https://code.launchpad.net/~jelmer/launchpad-buildd/remove-seek_end-constant/+merge/83771
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jelmer/launchpad-buildd/remove-seek_end-constant into lp:launchpad-buildd.
=== modified file 'debian/changelog'
--- debian/changelog	2011-11-29 12:34:41 +0000
+++ debian/changelog	2011-11-29 12:49:14 +0000
@@ -2,8 +2,10 @@
 
   * Use the actual target distroseries name in changelog, rather than
     the same as the last entry. LP: #855479
+  * Use os.SEEK_END constant now that all build slaves run at least
+    hardy. LP: #239213
 
- -- Jelmer Vernooij <jelmer@xxxxxxxxxx>  Tue, 29 Nov 2011 13:34:21 +0100
+ -- Jelmer Vernooij <jelmer@xxxxxxxxxx>  Tue, 29 Nov 2011 13:38:07 +0100
 
 launchpad-buildd (109) hardy; urgency=low
 

=== modified file 'lpbuildd/slave.py'
--- lpbuildd/slave.py	2011-11-18 08:32:22 +0000
+++ lpbuildd/slave.py	2011-11-29 12:49:14 +0000
@@ -19,11 +19,6 @@
 from twisted.internet import process
 from twisted.web import xmlrpc
 
-# cprov 20080611: in python2.4 posixfile.SEEK_END is deprecated and our
-# importfascist-check denies its import. When we migrate to python2.5,
-# we can use os.SEEK_END. See bug #239213.
-SEEK_END = 2
-
 devnull = open("/dev/null", "r")
 
 
@@ -418,11 +413,11 @@
                 # We rely on good OS practices that keep the file handler
                 # usable once it's opened. So, if open() is ok, a subsequent
                 # seek/tell/read will be safe.
-                rlog.seek(0, SEEK_END)
+                rlog.seek(0, os.SEEK_END)
                 count = rlog.tell()
                 if count > 2048:
                     count = 2048
-                rlog.seek(-count, SEEK_END)
+                rlog.seek(-count, os.SEEK_END)
                 ret = rlog.read(count)
         finally:
             if rlog is not None:


Follow ups