Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
83bb9a2b
Commit
83bb9a2b
authored
Oct 25, 2013
by
Tim Golden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue14255 Don't flatten case of tempdir
parent
98fa4402
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
Lib/tempfile.py
Lib/tempfile.py
+1
-1
Lib/test/test_tempfile.py
Lib/test/test_tempfile.py
+14
-0
Lib/test/test_zipimport_support.py
Lib/test/test_zipimport_support.py
+4
-2
No files found.
Lib/tempfile.py
View file @
83bb9a2b
...
@@ -146,7 +146,7 @@ def _get_default_tempdir():
...
@@ -146,7 +146,7 @@ def _get_default_tempdir():
for
dir
in
dirlist
:
for
dir
in
dirlist
:
if
dir
!=
_os
.
curdir
:
if
dir
!=
_os
.
curdir
:
dir
=
_os
.
path
.
normcase
(
_os
.
path
.
abspath
(
dir
)
)
dir
=
_os
.
path
.
abspath
(
dir
)
# Try only a few names per directory.
# Try only a few names per directory.
for
seq
in
range
(
100
):
for
seq
in
range
(
100
):
name
=
next
(
namer
)
name
=
next
(
namer
)
...
...
Lib/test/test_tempfile.py
View file @
83bb9a2b
...
@@ -478,6 +478,20 @@ class TestGetTempDir(BaseTestCase):
...
@@ -478,6 +478,20 @@ class TestGetTempDir(BaseTestCase):
self
.
assertTrue
(
a
is
b
)
self
.
assertTrue
(
a
is
b
)
def
test_case_sensitive
(
self
):
# gettempdir should not flatten its case
# even on a case-insensitive file system
case_sensitive_tempdir
=
tempfile
.
mkdtemp
(
"-Temp"
)
_tempdir
,
tempfile
.
tempdir
=
tempfile
.
tempdir
,
None
try
:
with
support
.
EnvironmentVarGuard
()
as
env
:
# Fake the first env var which is checked as a candidate
env
[
"TMPDIR"
]
=
case_sensitive_tempdir
self
.
assertEqual
(
tempfile
.
gettempdir
(),
case_sensitive_tempdir
)
finally
:
tempfile
.
tempdir
=
_tempdir
support
.
rmdir
(
case_sensitive_tempdir
)
class
TestMkstemp
(
BaseTestCase
):
class
TestMkstemp
(
BaseTestCase
):
"""Test mkstemp()."""
"""Test mkstemp()."""
...
...
Lib/test/test_zipimport_support.py
View file @
83bb9a2b
...
@@ -227,13 +227,15 @@ class ZipSupportTests(unittest.TestCase):
...
@@ -227,13 +227,15 @@ class ZipSupportTests(unittest.TestCase):
p
=
spawn_python
(
script_name
)
p
=
spawn_python
(
script_name
)
p
.
stdin
.
write
(
b'l
\
n
'
)
p
.
stdin
.
write
(
b'l
\
n
'
)
data
=
kill_python
(
p
)
data
=
kill_python
(
p
)
self
.
assertIn
(
script_name
.
encode
(
'utf-8'
),
data
)
# bdb/pdb applies normcase to its filename before displaying
self
.
assertIn
(
os
.
path
.
normcase
(
script_name
.
encode
(
'utf-8'
)),
data
)
zip_name
,
run_name
=
make_zip_script
(
d
,
"test_zip"
,
zip_name
,
run_name
=
make_zip_script
(
d
,
"test_zip"
,
script_name
,
'__main__.py'
)
script_name
,
'__main__.py'
)
p
=
spawn_python
(
zip_name
)
p
=
spawn_python
(
zip_name
)
p
.
stdin
.
write
(
b'l
\
n
'
)
p
.
stdin
.
write
(
b'l
\
n
'
)
data
=
kill_python
(
p
)
data
=
kill_python
(
p
)
self
.
assertIn
(
run_name
.
encode
(
'utf-8'
),
data
)
# bdb/pdb applies normcase to its filename before displaying
self
.
assertIn
(
os
.
path
.
normcase
(
run_name
.
encode
(
'utf-8'
)),
data
)
def
test_main
():
def
test_main
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment