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

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

This proposal has been superseded by a proposal from 2011-12-19.

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.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

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
Revision history for this message
Martin Pool (mbp) wrote :

vote approve

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-12-16 14:04:01 +0000
3+++ bzrlib/config.py 2011-12-18 02:57:24 +0000
4@@ -72,6 +72,7 @@
5 up=pull
6 """
7
8+from cStringIO import StringIO
9 import os
10 import sys
11
12@@ -81,7 +82,6 @@
13 lazy_import(globals(), """
14 import fnmatch
15 import re
16-from cStringIO import StringIO
17
18 from bzrlib import (
19 atomicfile,
20
21=== modified file 'doc/en/release-notes/bzr-2.5.txt'
22--- doc/en/release-notes/bzr-2.5.txt 2011-12-15 14:47:22 +0000
23+++ doc/en/release-notes/bzr-2.5.txt 2011-12-18 02:57:24 +0000
24@@ -53,6 +53,9 @@
25 * Allow configuration option default value to be a python callable at
26 registration. (Vincent Ladeuil, #832064)
27
28+* cStringIO is now unconditionally imported in ``bzrlib.config``.
29+ (Jelmer Vernooij, #905361)
30+
31 * Create obsolete_packs directory when repacking if it does not
32 exist. (Jonathan Riddell, Jelmer Vernooij, #314314)
33