Rev 5263: (parthm) (parthm) added tip on explicit file closing to 'Portability Tips' in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu May 27 08:23:03 BST 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5263 [merge]
revision-id: pqm at pqm.ubuntu.com-20100527072300-2ne7hfu800189v4q
parent: pqm at pqm.ubuntu.com-20100527041407-3awh3n2osfpsb5iy
parent: parth.malwankar at gmail.com-20100527045513-ada6nch1ngs2b2ln
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2010-05-27 08:23:00 +0100
message:
  (parthm) (parthm) added tip on explicit file closing to 'Portability Tips'
   section of code-style.txt (Parth Malwankar)
modified:
  doc/developers/HACKING.txt     HACKING-20050805200004-2a5dc975d870f78c
  doc/developers/code-style.txt  codestyle.txt-20100515105711-133ealf7ereiq2eq-1
=== modified file 'doc/developers/HACKING.txt'
--- a/doc/developers/HACKING.txt	2010-05-16 09:29:44 +0000
+++ b/doc/developers/HACKING.txt	2010-05-27 04:55:13 +0000
@@ -12,8 +12,7 @@
 document, send a merge request or new text to the mailing list.
 
 The latest developer documentation can be found online at
-http://doc.bazaar-vcs.org/developers/.
-
+http://doc.bazaar.canonical.com/developers/.
 
 Getting Started
 ###############
@@ -29,7 +28,7 @@
 To answer these questions and more, take a moment to explore the
 overall Bazaar Platform. Here are some links to browse:
 
-* The Plugins page on the Wiki - http://bazaar-vcs.org/BzrPlugins
+* The Plugins page on the Wiki - http://wiki.bazaar.canonical.com/BzrPlugins
 
 * The Bazaar product family on Launchpad - https://launchpad.net/bazaar
 
@@ -53,7 +52,7 @@
 
 There is a very active community around Bazaar. Mostly we meet on IRC
 (#bzr on irc.freenode.net) and on the mailing list. To join the Bazaar
-community, see http://bazaar-vcs.org/BzrSupport.
+community, see http://wiki.bazaar.canonical.com/BzrSupport.
 
 If you are planning to make a change, it's a very good idea to mention it
 on the IRC channel and/or on the mailing list. There are many advantages
@@ -202,7 +201,7 @@
 
 * Launchpad - https://launchpad.net/
 
-* Bazaar - http://bazaar-vcs.org/
+* Bazaar - http://bazaar.canonical.com/
 
 * Patch Queue Manager - https://launchpad.net/pqm/
 
@@ -215,7 +214,7 @@
 ================================================
 
 Bazaar supports many ways of organising your work. See
-http://bazaar-vcs.org/SharedRepositoryLayouts for a summary of the
+http://wiki.bazaar.canonical.com/SharedRepositoryLayouts for a summary of the
 popular alternatives.
 
 Of course, the best choice for you will depend on numerous factors:
@@ -292,7 +291,7 @@
 <http://starship.python.net/crew/mwh/bzrlibapi/>.
 
 See also the `Bazaar Architectural Overview
-<http://doc.bazaar-vcs.org/developers/overview.html>`_.
+<http://doc.bazaar.canonical.com/developers/overview.html>`_.
 
 
 Core Topics
@@ -824,8 +823,7 @@
 Making Installers for OS Windows
 ================================
 To build a win32 installer, see the instructions on the wiki page:
-http://bazaar-vcs.org/BzrWin32Installer
-
+http://wiki.bazaar.canonical.com/BzrWin32Installer
 
 Core Developer Tasks
 ####################
@@ -844,7 +842,7 @@
 * reviewing changes
 * reviewing blueprints
 * planning releases
-* managing releases (see `Releasing Bazaar <http://doc.bazaar-vcs.org/developers/releasing.html>`_)
+* managing releases (see `Releasing Bazaar <http://doc.bazaar.canonical.com/developers/releasing.html>`_)
 
 .. note::
   Removing barriers to community participation is a key reason for adopting
@@ -896,7 +894,7 @@
 Of the many workflows supported by Bazaar, the one adopted for Bazaar
 development itself is known as "Decentralized with automatic gatekeeper".
 To repeat the explanation of this given on
-http://bazaar-vcs.org/Workflows:
+http://wiki.bazaar.canonical.com/Workflows:
 
 .. pull-quote::
   In this workflow, each developer has their own branch or

=== modified file 'doc/developers/code-style.txt'
--- a/doc/developers/code-style.txt	2010-05-27 02:06:11 +0000
+++ b/doc/developers/code-style.txt	2010-05-27 04:55:13 +0000
@@ -341,7 +341,7 @@
 =============
 
 All code should be exercised by the test suite.  See the `Bazaar Testing
-Guide <http://doc.bazaar-vcs.org/developers/testing.html>`_ for detailed
+Guide <http://doc.bazaar.canonical.com/developers/testing.html>`_ for detailed
 information about writing tests.
 
 
@@ -411,7 +411,17 @@
 to fail on Windows if some files are readonly or still open elsewhere.
 Use ``bzrlib.osutils.rmtree`` instead.
 
+Using the ``open(..).read(..)`` or ``open(..).write(..)`` style chaining
+of methods for reading or writing file content relies on garbage collection
+to close the file which may keep the file open for an undefined period of
+time. This may break some follow up operations like rename on Windows.
+Use ``try/finally`` to explictly close the file. E.g.::
 
+    f = open('foo.txt', 'w')
+    try:
+        f.write(s)
+    finally:
+        f.close()
 
 ..
    vim: ft=rst tw=74 ai




More information about the bazaar-commits mailing list