A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/python/cpython/commit/2efe18bf277dd0f38a1d248ae6bdd30947c26880 below:

Support file systems that cannot support non-ascii filenam… · python/cpython@2efe18b · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+18

-2

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+18

-2

lines changed Original file line number Diff line number Diff line change

@@ -210,6 +210,17 @@ def build_files(file_defs, prefix=pathlib.Path()):

210 210

f.write(DALS(contents))

211 211 212 212 213 +

class FileBuilder:

214 +

def unicode_filename(self):

215 +

try:

216 +

import test.support

217 +

except ImportError:

218 +

# outside CPython, hard-code a unicode snowman

219 +

return '☃'

220 +

return test.support.FS_NONASCII or \

221 +

self.skip("File system does not support non-ascii.")

222 + 223 + 213 224

def DALS(str):

214 225

"Dedent and left-strip"

215 226

return textwrap.dedent(str).lstrip()

Original file line number Diff line number Diff line change

@@ -254,11 +254,16 @@ def test_attr(self):

254 254

assert self.ep.attr is None

255 255 256 256 257 -

class FileSystem(fixtures.OnSysPath, fixtures.SiteDir, unittest.TestCase):

257 +

class FileSystem(

258 +

fixtures.OnSysPath, fixtures.SiteDir, fixtures.FileBuilder,

259 +

unittest.TestCase):

258 260

def test_unicode_dir_on_sys_path(self):

259 261

"""

260 262

Ensure a Unicode subdirectory of a directory on sys.path

261 263

does not crash.

262 264

"""

263 -

fixtures.build_files({'☃': {}}, prefix=self.site_dir)

265 +

fixtures.build_files(

266 +

{self.unicode_filename(): {}},

267 +

prefix=self.site_dir,

268 +

)

264 269

list(distributions())

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4