Merge lp:~jelmer/bzr/direct-cstringio-import into lp:bzr/2.3

Proposed by Jelmer Vernooij on 2011-12-19
Status: Merged
Approved by: Martin Packman on 2011-12-19
Approved revision: 5665
Merged at revision: 5665
Proposed branch: lp:~jelmer/bzr/direct-cstringio-import
Merge into: lp:bzr/2.3
Diff against target: 32 lines (+4/-1)
2 files modified
bzrlib/config.py (+1/-1)
doc/en/release-notes/bzr-2.3.txt (+3/-0)
To merge this branch: bzr merge lp:~jelmer/bzr/direct-cstringio-import
Reviewer Review Type Date Requested Status
Martin Packman (community) 2011-12-19 Approve on 2011-12-19
Review via email: mp+86221@code.launchpad.net

This proposal supersedes a proposal from 2011-12-18.

Commit message

Directly import cStringIO in bzrlib.config to prevent lazy import scope errors.

Description of the change

Directly import cStringIO in bzrlib.config, rather than through
lazy_import. This fixes a IllegalUseOfScopeReplacer error that Adi was
running into.

We use cStringIO heavily, so - like e.g. the os module - it seems impossible
to avoid it anyway.

(resubmitted against 2.3)

To post a comment you must log in.
Martin Packman (gz) wrote : Posted in a previous version of this proposal

Yeah, this is the change I was thinking of, but would retarget to 2.3 as it's safe and that's the version being used by the reporter. For trunk, we want the full fix of changing lazy imports to be less thread-ignorant, as in:

<https://code.launchpad.net/~gagern/bzr/bug396819-lazy_import-threadsafe/+merge/73475>

review: Approve
Martin Pool (mbp) wrote : Posted in a previous version of this proposal

vote approve

Martin Packman (gz) wrote :

Thanks!

review: Approve
Jelmer Vernooij (jelmer) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/config.py'
2--- bzrlib/config.py 2011-04-01 03:07:34 +0000
3+++ bzrlib/config.py 2011-12-19 11:28:27 +0000
4@@ -62,6 +62,7 @@
5 up=pull
6 """
7
8+from cStringIO import StringIO
9 import os
10 import string
11 import sys
12@@ -73,7 +74,6 @@
13 import errno
14 import fnmatch
15 import re
16-from cStringIO import StringIO
17
18 import bzrlib
19 from bzrlib import (
20
21=== modified file 'doc/en/release-notes/bzr-2.3.txt'
22--- doc/en/release-notes/bzr-2.3.txt 2011-11-10 10:46:54 +0000
23+++ doc/en/release-notes/bzr-2.3.txt 2011-12-19 11:28:27 +0000
24@@ -35,6 +35,9 @@
25 * Cope cleanly with buggy HTTP proxies that close the socket in the middle
26 of a multipart response. (Martin Pool, #198646).
27
28+* cStringIO is now unconditionally imported in ``bzrlib.config``.
29+ (Jelmer Vernooij, #905361)
30+
31 * Fix "Unprintable exception" error when a RetryWithNewPacks error is
32 displayed. (Andrew Bennetts)
33

Subscribers

People subscribed via source and target branches