Ticket #1329: 1329.diff
File 1329.diff, 25.8 KB (added by zooko, at 2011-01-18T07:26:18Z) |
---|
-
Makefile
diff -rN -u old-ticket1329/Makefile new-ticket1329/Makefile
old new 179 179 180 180 181 181 pyflakes: 182 $(PYTHON) -OOu `which pyflakes` src/allmydata |sort |uniq182 $(PYTHON) -OOu `which pyflakes` src/allmydata static |sort |uniq 183 183 check-umids: 184 184 $(PYTHON) misc/coding_tools/check-umids.py `find src/allmydata -name '*.py'` 185 185 -
src/allmydata/__init__.py
diff -rN -u old-ticket1329/src/allmydata/__init__.py new-ticket1329/src/allmydata/__init__.py
old new 4 4 community web site: U{http://tahoe-lafs.org/} 5 5 """ 6 6 7 # We want to call require_auto_deps() before other imports, because the setuptools8 # docs claim that if a distribution is installed with --multi-version, it might not9 # be importable until after pkg_resources.require() has been called for it. We don't10 # have an example of this happening at this time. It is possible that require() isn't11 # actually needed because we set __requires__ in the generated startup script, but12 # that would be an undocumented property of the setuptools implementation.13 14 from allmydata import _auto_deps15 _auto_deps.require_auto_deps()16 17 # This is just to suppress DeprecationWarnings from nevow and twisted.18 # See http://allmydata.org/trac/tahoe/ticket/859 and19 # http://divmod.org/trac/ticket/2994 .20 import warnings21 warnings.filterwarnings("ignore", category=DeprecationWarning,22 message="the sha module is deprecated; use the hashlib module instead",23 append=True)24 warnings.filterwarnings("ignore", category=DeprecationWarning,25 message="object.__new__\(\) takes no parameters",26 append=True)27 warnings.filterwarnings("ignore", category=DeprecationWarning,28 message="The popen2 module is deprecated. Use the subprocess module.",29 append=True)30 warnings.filterwarnings("ignore", category=DeprecationWarning,31 message="the md5 module is deprecated; use hashlib instead",32 append=True)33 warnings.filterwarnings("ignore", category=DeprecationWarning,34 message="twisted.web.error.NoResource is deprecated since Twisted 9.0. See twisted.web.resource.NoResource.",35 append=True)36 try:37 import nevow38 from twisted.persisted import sob39 from twisted.python import filepath40 hush_pyflakes = (nevow, sob, filepath)41 del hush_pyflakes42 finally:43 warnings.filters.pop()44 warnings.filters.pop()45 warnings.filters.pop()46 warnings.filters.pop()47 # Don't pop the filter for the sha module warning because it is also generated48 # by pycrypto (which we don't want to import unless needed).49 # warnings.filters.pop()50 51 # This warning is generated by twisted, PyRex, and possibly other packages,52 # but can happen at any time, not only when they are imported. See53 # http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1129 .54 warnings.filterwarnings("ignore", category=DeprecationWarning,55 message="BaseException.message has been deprecated as of Python 2.6",56 append=True)57 58 7 __version__ = "unknown" 59 8 try: 60 9 from allmydata._version import __version__ … … 175 124 else: 176 125 return platform.platform() 177 126 178 def get_package_versions_from_setuptools():179 import pkg_resources180 return dict([(p.project_name, (p.version, p.location)) for p in pkg_resources.require(__appname__)])181 182 def package_dir(srcfile):183 return os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(srcfile))))184 185 def get_package_versions_and_locations():186 # because there are a few dependencies that are outside setuptools's ken187 # (Python and platform, and sqlite3 if you are on Python >= 2.5), and188 # because setuptools might fail to find something even though import189 # finds it:190 import OpenSSL, allmydata, foolscap.api, nevow, platform, pycryptopp, setuptools, simplejson, twisted, zfec, zope.interface191 pysqlitever = None192 pysqlitefile = None193 sqlitever = None194 try:195 import sqlite3196 except ImportError:197 try:198 from pysqlite2 import dbapi2199 except ImportError:200 pass201 else:202 pysqlitever = dbapi2.version203 pysqlitefile = package_dir(dbapi2.__file__)204 sqlitever = dbapi2.sqlite_version205 else:206 pysqlitever = sqlite3.version207 pysqlitefile = package_dir(sqlite3.__file__)208 sqlitever = sqlite3.sqlite_version209 210 d1 = {211 'pyOpenSSL': (OpenSSL.__version__, package_dir(OpenSSL.__file__)),212 __appname__: (allmydata.__version__, package_dir(allmydata.__file__)),213 'foolscap': (foolscap.api.__version__, package_dir(foolscap.__file__)),214 'Nevow': (nevow.__version__, package_dir(nevow.__file__)),215 'pycryptopp': (pycryptopp.__version__, package_dir(pycryptopp.__file__)),216 'setuptools': (setuptools.__version__, package_dir(setuptools.__file__)),217 'simplejson': (simplejson.__version__, package_dir(simplejson.__file__)),218 'pysqlite': (pysqlitever, pysqlitefile),219 'sqlite': (sqlitever, 'unknown'),220 'zope.interface': ('unknown', package_dir(zope.interface.__file__)),221 'Twisted': (twisted.__version__, package_dir(twisted.__file__)),222 'zfec': (zfec.__version__, package_dir(zfec.__file__)),223 'python': (platform.python_version(), sys.executable),224 'platform': (get_platform(), None),225 }226 127 227 # But we prefer to get all the dependencies as known by setuptools: 228 import pkg_resources 229 try: 230 d2 = get_package_versions_from_setuptools() 231 except pkg_resources.DistributionNotFound: 232 # See docstring in _auto_deps.require_auto_deps() to explain why it makes sense to ignore this exception. 233 pass 128 from allmydata._auto_deps import get_package_versions_and_locations 129 130 _vers_and_locs = get_package_versions_and_locations() 131 _vers_and_locs['platform'] = (get_platform(), None) 132 133 134 def check_all_requirements(): 135 import platform 136 from distutils.version import LooseVersion 137 from allmydata._auto_deps import install_requires 138 139 # we require 2.4.4 on non-UCS-2, non-Redhat builds to avoid <http://www.python.org/news/security/PSF-2006-001/> 140 # we require 2.4.3 on non-UCS-2 Redhat, because 2.4.3 is common on Redhat-based distros and will have patched the above bug 141 # we require at least 2.4.2 in any case to avoid a bug in the base64 module: <http://bugs.python.org/issue1171487> 142 if sys.maxunicode == 65535: 143 if sys.version_info < (2, 4, 2) or sys.version_info[0] > 2: 144 raise NotImplementedError("Tahoe-LAFS current requires Python v2.4.2 or greater " 145 "for a UCS-2 build (but less than v3), not %r" % 146 (sys.version_info,)) 147 elif platform.platform().lower().find('redhat') >= 0: 148 if sys.version_info < (2, 4, 3) or sys.version_info[0] > 2: 149 raise NotImplementedError("Tahoe-LAFS current requires Python v2.4.3 or greater " 150 "on Redhat-based distributions (but less than v3), not %r" % 151 (sys.version_info,)) 234 152 else: 235 d1.update(d2) 153 if sys.version_info < (2, 4, 4) or sys.version_info[0] > 2: 154 raise NotImplementedError("Tahoe-LAFS current requires Python v2.4.4 or greater " 155 "for a non-UCS-2 build (but less than v3), not %r" % 156 (sys.version_info,)) 157 158 def check_requirement(req): 159 # We only support a single >= or ==. 160 def _check(s, ok, relation): 161 name = s[0].strip(' ').partition('[')[0] 162 required = s[1].strip(' ') 163 if name not in _vers_and_locs: 164 raise AssertionError("no version info for %s" % (name,)) 165 (actual, location) = _vers_and_locs[name] 166 actual = str(actual) 167 if actual != 'unknown' and not ok(LooseVersion(actual), LooseVersion(required)): 168 msg = ("We require %s version %s of %s, but could only find version %s.\n" 169 % (relation, required, name, actual)) 170 if location and location != 'unknown': 171 msg += "The version we found is from %r.\n" % (location,) 172 msg += ("To resolve this problem, uninstall that version, either using your\n" 173 "operating system's package manager or by moving aside the directory.") 174 raise AssertionError(msg) 175 176 s = req.split('>=') 177 if len(s) == 2: 178 _check(s, lambda x, y: x >= y, "at least") 179 return 180 s = req.split('==') 181 if len(s) == 2: 182 _check(s, lambda x, y: x == y, "exactly") 183 return 184 if req not in _vers_and_locs: 185 raise AssertionError("no version info or could not understand requirement for %r" % (req)) 186 187 for requirement in install_requires: 188 check_requirement(requirement) 189 190 check_all_requirements() 236 191 237 return d1238 192 239 193 def get_package_versions(): 240 return dict([(k, v) for k, (v, l) in get_package_versions_and_locations().iteritems()])194 return dict([(k, v) for k, (v, l) in _vers_and_locs.iteritems()]) 241 195 242 196 def get_package_locations(): 243 return dict([(k, l) for k, (v, l) in get_package_versions_and_locations().iteritems()])197 return dict([(k, l) for k, (v, l) in _vers_and_locs.iteritems()]) 244 198 245 199 def get_package_versions_string(show_paths=False): 246 vers_and_locs = get_package_versions_and_locations()247 200 res = [] 248 for p in [__appname__, "foolscap", "pycryptopp", "zfec", "Twisted", "Nevow", "zope.interface", "python", "platform"]: 249 (ver, loc) = vers_and_locs.get(p, ('UNKNOWN', 'UNKNOWN')) 201 first = [__appname__, "foolscap", "pycryptopp", "zfec", "Twisted", "Nevow", "zope.interface", "python", "platform"] 202 for p in first: 203 (ver, loc) = _vers_and_locs.get(p, ('UNKNOWN', 'UNKNOWN')) 250 204 info = str(p) + ": " + str(ver) 251 205 if show_paths: 252 206 info = info + " (%s)" % str(loc) 253 207 res.append(info) 254 if vers_and_locs.has_key(p):255 del vers_and_locs[p]256 208 257 for p, (v, loc) in vers_and_locs.iteritems(): 258 info = str(p) + ": " + str(v) 259 if show_paths: 260 info = info + " (%s)" % str(loc) 261 res.append(info) 209 for p, (v, loc) in _vers_and_locs.iteritems(): 210 if p not in first: 211 info = str(p) + ": " + str(v) 212 if show_paths: 213 info = info + " (%s)" % str(loc) 214 res.append(info) 215 262 216 return ', '.join(res) -
src/allmydata/_auto_deps.py
diff -rN -u old-ticket1329/src/allmydata/_auto_deps.py new-ticket1329/src/allmydata/_auto_deps.py
old new 1 1 # Note: do not import any module from Tahoe-LAFS itself in this 2 2 # file. Also please avoid importing modules from other packages than 3 # the Python Standard Library if at all possible (exception: we rely 4 # on importing pkg_resources, which is provided by setuptools, 5 # zetuptoolz, distribute, and perhaps in the future distutils2, for 6 # the require_auto_deps() function.) 3 # the Python Standard Library if at all possible. That includes 4 # setuptools and pkg_resources. 5 6 # If you add or remove dependencies, please remember to update 7 # get_package_versions_and_locations() below. 7 8 8 9 install_requires=[ 9 10 # we require newer versions of setuptools (actually … … 27 28 28 29 # Needed for SFTP. pyasn1 is needed by twisted.conch in Twisted >= 9.0. 29 30 # pycrypto 2.2 doesn't work due to https://bugs.launchpad.net/pycrypto/+bug/620253 30 "pycrypto == 2.0.1, == 2.1,>= 2.3",31 "pycrypto >= 2.3", 31 32 "pyasn1 >= 0.0.8a", 32 33 33 34 # Will be needed to test web apps, but not yet. See #1001. … … 74 75 install_requires=[] 75 76 del sys # clean up namespace 76 77 77 def require_python_version():78 import sys, platform79 78 80 # we require 2.4.4 on non-UCS-2, non-Redhat builds to avoid <http://www.python.org/news/security/PSF-2006-001/> 81 # we require 2.4.3 on non-UCS-2 Redhat, because 2.4.3 is common on Redhat-based distros and will have patched the above bug 82 # we require at least 2.4.2 in any case to avoid a bug in the base64 module: <http://bugs.python.org/issue1171487> 83 if sys.maxunicode == 65535: 84 if sys.version_info < (2, 4, 2) or sys.version_info[0] > 2: 85 raise NotImplementedError("Tahoe-LAFS current requires Python v2.4.2 or greater " 86 "for a UCS-2 build (but less than v3), not %r" % 87 (sys.version_info,)) 88 elif platform.platform().lower().find('redhat') >= 0: 89 if sys.version_info < (2, 4, 3) or sys.version_info[0] > 2: 90 raise NotImplementedError("Tahoe-LAFS current requires Python v2.4.3 or greater " 91 "on Redhat-based distributions (but less than v3), not %r" % 92 (sys.version_info,)) 79 def get_package_versions_and_locations(): 80 import warnings, os, sys 81 def package_dir(srcfile): 82 return os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(srcfile)))) 83 84 # pkg_resources.require returns the distribution that pkg_resources attempted to put 85 # on sys.path, which can differ from the one that we actually import due to #1258, 86 # or any other bug that causes sys.path to be set up incorrectly. Therefore we 87 # must import the packages in order to check their versions and paths. Note that 88 # this needs to be updated if dependencies are added or removed. 89 90 # This warning is generated by twisted, PyRex, and possibly other packages, 91 # but can happen at any time, not only when they are imported. See 92 # http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1129 . 93 warnings.filterwarnings("ignore", category=DeprecationWarning, 94 message="BaseException.message has been deprecated as of Python 2.6", 95 append=True) 96 97 # This is to suppress DeprecationWarnings from nevow, twisted, and pycrypto. 98 # See http://allmydata.org/trac/tahoe/ticket/859 and 99 # http://divmod.org/trac/ticket/2994 . 100 warnings.filterwarnings("ignore", category=DeprecationWarning, 101 message="the sha module is deprecated; use the hashlib module instead", 102 append=True) 103 warnings.filterwarnings("ignore", category=DeprecationWarning, 104 message="object.__new__\(\) takes no parameters", 105 append=True) 106 warnings.filterwarnings("ignore", category=DeprecationWarning, 107 message="The popen2 module is deprecated. Use the subprocess module.", 108 append=True) 109 warnings.filterwarnings("ignore", category=DeprecationWarning, 110 message="the md5 module is deprecated; use hashlib instead", 111 append=True) 112 warnings.filterwarnings("ignore", category=DeprecationWarning, 113 message="twisted.web.error.NoResource is deprecated since Twisted 9.0. See twisted.web.resource.NoResource.", 114 append=True) 115 warnings.filterwarnings("ignore", category=DeprecationWarning, 116 message="the sets module is deprecated", 117 append=True) 118 try: 119 import nevow 120 from twisted.persisted import sob 121 from twisted.python import filepath 122 import Crypto 123 import foolscap.api 124 [sob, filepath] # hush pyflakes 125 finally: 126 for n in range(6): 127 warnings.filters.pop() 128 129 import OpenSSL, allmydata, platform, pycryptopp, simplejson, twisted, zfec, zope.interface, pyasn1, mock 130 pysqlitever = None 131 pysqlitefile = None 132 sqlitever = None 133 try: 134 import sqlite3 135 except ImportError: 136 try: 137 from pysqlite2 import dbapi2 138 except ImportError: 139 pass 140 else: 141 pysqlitever = dbapi2.version 142 pysqlitefile = package_dir(dbapi2.__file__) 143 sqlitever = dbapi2.sqlite_version 93 144 else: 94 if sys.version_info < (2, 4, 4) or sys.version_info[0] > 2: 95 raise NotImplementedError("Tahoe-LAFS current requires Python v2.4.4 or greater " 96 "for a non-UCS-2 build (but less than v3), not %r" % 97 (sys.version_info,)) 98 99 def require_auto_deps(): 100 """ 101 The purpose of this function is to raise a pkg_resources exception if any of the 102 requirements can't be imported. This is just to give earlier and more explicit error 103 messages, as opposed to waiting until the source code tries to import some module from one 104 of these packages and gets an ImportError. This function gets called from 105 src/allmydata/__init__.py . 106 """ 107 require_python_version() 145 pysqlitever = sqlite3.version 146 pysqlitefile = package_dir(sqlite3.__file__) 147 sqlitever = sqlite3.sqlite_version 148 149 packages = { 150 'pyopenssl': (OpenSSL.__version__, package_dir(OpenSSL.__file__)), 151 allmydata.__appname__: (allmydata.__version__, package_dir(allmydata.__file__)), 152 'foolscap': (foolscap.api.__version__, package_dir(foolscap.__file__)), 153 'Nevow': (nevow.__version__, package_dir(nevow.__file__)), 154 'pycryptopp': (pycryptopp.__version__, package_dir(pycryptopp.__file__)), 155 'simplejson': (simplejson.__version__, package_dir(simplejson.__file__)), 156 'pysqlite': (pysqlitever, pysqlitefile), 157 'sqlite': (sqlitever, 'unknown'), 158 'zope.interface': ('unknown', package_dir(zope.interface.__file__)), 159 'Twisted': (twisted.__version__, package_dir(twisted.__file__)), 160 'zfec': (zfec.__version__, package_dir(zfec.__file__)), 161 'pycrypto': (Crypto.__version__, package_dir(Crypto.__file__)), 162 'pyasn1': ('unknown', package_dir(pyasn1.__file__)), 163 'mock': (mock.__version__, package_dir(mock.__file__)), 164 'python': (platform.python_version(), sys.executable), 165 } 108 166 109 import pkg_resources 110 for requirement in install_requires: 167 if sys.platform == 'win32': 111 168 try: 112 pkg_resources.require(requirement) 113 except pkg_resources.DistributionNotFound: 114 # there is no .egg-info present for this requirement, which 115 # either means that it isn't installed, or it is installed in a 116 # way that pkg_resources can't find it (but regular python 117 # might). There are several older Linux distributions which 118 # provide our dependencies just fine, but they don't ship 119 # .egg-info files. Note that if there *is* an .egg-info file, 120 # but it shows a too-old version, then we'll get a 121 # VersionConflict error instead of DistributionNotFound. 169 import win32api 170 packages['pywin32'] = ('unknown', package_dir(win32api.__file__)) 171 except ImportError: 122 172 pass 173 174 if not hasattr(sys, 'frozen'): 175 # Don't try to get the setuptools version if using bbfreeze, py2exe etc. See #585. 176 import setuptools 177 packages['setuptools'] = (setuptools.__version__, package_dir(setuptools.__file__)) 178 179 return packages -
src/allmydata/test/test_runner.py
diff -rN -u old-ticket1329/src/allmydata/test/test_runner.py new-ticket1329/src/allmydata/test/test_runner.py
old new 3 3 4 4 from twisted.python import usage, runtime 5 5 from twisted.internet import utils 6 import os.path, re, sys 6 import os.path, re, sys, subprocess 7 7 from cStringIO import StringIO 8 8 from allmydata.util import fileutil, pollmixin 9 9 from allmydata.util.encodingutil import unicode_to_argv, unicode_to_output, get_filesystem_encoding … … 14 14 15 15 timeout = 240 16 16 17 def get_root_from_file(src): 18 srcdir = os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(src)))) 19 20 root = os.path.dirname(srcdir) 21 if os.path.basename(srcdir) == 'site-packages': 22 if re.search(r'python.+\..+', os.path.basename(root)): 23 root = os.path.dirname(root) 24 root = os.path.dirname(root) 25 elif os.path.basename(root) == 'src': 26 root = os.path.dirname(root) 27 28 return root 29 17 30 srcfile = allmydata.__file__ 18 srcdir = os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(srcfile))))31 rootdir = get_root_from_file(srcfile) 19 32 20 rootdir = os.path.dirname(srcdir) 21 if os.path.basename(srcdir) == 'site-packages': 22 if re.search(r'python.+\..+', os.path.basename(rootdir)): 23 rootdir = os.path.dirname(rootdir) 24 rootdir = os.path.dirname(rootdir) 25 elif os.path.basename(rootdir) == 'src': 26 rootdir = os.path.dirname(rootdir) 27 28 bintahoe = os.path.join(rootdir, 'bin', 'tahoe') 29 if sys.platform == "win32": 30 bintahoe += ".pyscript" 31 if not os.path.exists(bintahoe): 32 alt_bintahoe = os.path.join(rootdir, 'Scripts', 'tahoe.pyscript') 33 if os.path.exists(alt_bintahoe): 34 bintahoe = alt_bintahoe 33 34 if hasattr(sys, 'frozen'): 35 bintahoe = os.path.join(rootdir, 'tahoe') 36 37 if sys.platform == "win32" and os.path.exists(bintahoe + '.exe'): 38 bintahoe += '.exe' 39 else: 40 bintahoe = os.path.join(rootdir, 'bin', 'tahoe') 41 if sys.platform == "win32": 42 bintahoe += '.pyscript' 43 if not os.path.exists(bintahoe): 44 alt_bintahoe = os.path.join(rootdir, 'Scripts', 'tahoe.pyscript') 45 if os.path.exists(alt_bintahoe): 46 bintahoe = alt_bintahoe 35 47 36 48 37 49 class SkipMixin: … … 49 61 50 62 51 63 class BinTahoe(common_util.SignalMixin, unittest.TestCase, SkipMixin): 52 def test_the_right_code(self): 64 def _check_right_code(self, file_to_check): 65 root_to_check = get_root_from_file(file_to_check) 66 if os.path.basename(root_to_check) == 'dist': 67 root_to_check = os.path.dirname(root_to_check) 68 53 69 cwd = os.path.normcase(os.path.realpath(".")) 54 70 root_from_cwd = os.path.dirname(cwd) 55 71 if os.path.basename(root_from_cwd) == 'src': 56 72 root_from_cwd = os.path.dirname(root_from_cwd) 57 73 58 same = (root_from_cwd == root dir)74 same = (root_from_cwd == root_to_check) 59 75 if not same: 60 76 try: 61 same = os.path.samefile(root_from_cwd, root dir)77 same = os.path.samefile(root_from_cwd, root_to_check) 62 78 except AttributeError, e: 63 79 e # hush pyflakes 64 80 … … 66 82 msg = ("We seem to be testing the code at %r,\n" 67 83 "(according to the source filename %r),\n" 68 84 "but expected to be testing the code at %r.\n" 69 % (root dir, srcfile, root_from_cwd))85 % (root_to_check, file_to_check, root_from_cwd)) 70 86 71 root_from_cwdu = os.path. normcase(os.path.normpath(os.getcwdu()))87 root_from_cwdu = os.path.dirname(os.path.normcase(os.path.normpath(os.getcwdu()))) 72 88 if os.path.basename(root_from_cwdu) == u'src': 73 89 root_from_cwdu = os.path.dirname(root_from_cwdu) 74 90 … … 81 97 msg += "Please run the tests from the root of the Tahoe-LAFS distribution." 82 98 self.fail(msg) 83 99 100 def test_the_right_code(self): 101 self._check_right_code(srcfile) 102 103 def test_import_in_repl(self): 104 self.skip_if_cannot_run_bintahoe() 105 106 args = [bintahoe, "debug", "repl"] 107 if not hasattr(sys, 'frozen'): 108 args = [sys.executable] + args 109 110 p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 111 (out, err) = p.communicate("import allmydata; print allmydata.__file__") 112 113 self.failUnlessEqual(p.returncode, 0) 114 first = out.splitlines()[0] 115 self.failUnless(first.startswith('>>> ')) 116 self._check_right_code(first[4:]) 117 84 118 def test_path(self): 85 119 self.skip_if_cannot_run_bintahoe() 86 120 d = utils.getProcessOutputAndValue(bintahoe, args=["--version-and-path"], env=os.environ) … … 112 146 else: 113 147 altverstr = verstr 114 148 149 srcdir = os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(srcfile)))) 115 150 required_ver_and_path = "%s: %s (%s)" % (allmydata.__appname__, verstr, srcdir) 116 151 alt_required_ver_and_path = "%s: %s (%s)" % (allmydata.__appname__, altverstr, srcdir) 117 152 … … 121 156 122 157 def test_unicode_arguments_and_output(self): 123 158 self.skip_if_cannot_run_bintahoe() 159 if hasattr(sys, 'frozen') and sys.platform == "win32": 160 raise unittest.SkipTest("This test can't currently be made to work for frozen executables on Windows,\ndue to lack of support for Unicode in twisted.internet.utils.getProcessOutputAndValue.") 124 161 125 162 tricky = u"\u2621" 126 163 try: … … 139 176 140 177 def test_run_with_python_options(self): 141 178 self.skip_if_cannot_run_bintahoe() 179 if hasattr(sys, 'frozen'): 180 raise unittest.SkipTest("This test doesn't apply to frozen executables.") 142 181 143 182 # -t is a harmless option that warns about tabs. 144 183 d = utils.getProcessOutputAndValue(sys.executable, args=['-t', bintahoe, '--version'], -
src/allmydata/test/test_system.py
diff -rN -u old-ticket1329/src/allmydata/test/test_system.py new-ticket1329/src/allmydata/test/test_system.py
old new 1769 1769 1770 1770 if env is None: 1771 1771 env = os.environ 1772 d = utils.getProcessOutputAndValue(sys.executable, args=[bintahoe] + argv, 1773 env=env) 1772 d = utils.getProcessOutputAndValue(bintahoe, argv, env=env) 1774 1773 return d 1775 1774 1776 1775 def _test_checker(self, res):