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

[dak/master] fdopen



who would have thought, os.fdopen really wants an fd, not a filename.

Signed-off-by: Joerg Jaspert <joerg@debian.org>
---
 dak/process_new.py |    2 +-
 daklib/queue.py    |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dak/process_new.py b/dak/process_new.py
index d742ac2..496e568 100755
--- a/dak/process_new.py
+++ b/dak/process_new.py
@@ -458,7 +458,7 @@ def edit_overrides (new):
 def edit_note(note):
     # Write the current data to a temporary file
     (fd, temp_filename) = utils.temp_filename()
-    temp_file = os.fdopen(temp_filename, 'w')
+    temp_file = os.fdopen(fd, 'w')
     temp_file.write(note)
     temp_file.close()
     editor = os.environ.get("EDITOR","vi")
diff --git a/daklib/queue.py b/daklib/queue.py
index 3ac52b3..1a4bb3b 100755
--- a/daklib/queue.py
+++ b/daklib/queue.py
@@ -501,7 +501,7 @@ distribution."""
                dsc.has_key("bts changelog"):
 
                 (fd, temp_filename) = utils.temp_filename(Cnf["Dir::Queue::BTSVersionTrack"], prefix=".")
-                version_history = os.fdopen(temp_filename, 'w')
+                version_history = os.fdopen(fd, 'w')
                 version_history.write(dsc["bts changelog"])
                 version_history.close()
                 filename = "%s/%s" % (Cnf["Dir::Queue::BTSVersionTrack"],
@@ -511,7 +511,7 @@ distribution."""
 
             # Write out the binary -> source mapping.
             (fd, temp_filename) = utils.temp_filename(Cnf["Dir::Queue::BTSVersionTrack"], prefix=".")
-            debinfo = os.fdopen(temp_filename, 'w')
+            debinfo = os.fdopen(fd, 'w')
             for file_entry in file_keys:
                 f = files[file_entry]
                 if f["type"] == "deb":
-- 
1.5.6.5


Reply to: