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
5bfe0da8
Commit
5bfe0da8
authored
Apr 19, 2016
by
Victor Stinner
Browse files
Options
Browse Files
Download
Plain Diff
Merge 3.5: issue #26801
parents
0fea25af
119ebb70
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
1 deletion
+8
-1
Lib/shutil.py
Lib/shutil.py
+1
-1
Lib/test/test_shutil.py
Lib/test/test_shutil.py
+2
-0
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+4
-0
No files found.
Lib/shutil.py
View file @
5bfe0da8
...
...
@@ -1072,7 +1072,7 @@ def get_terminal_size(fallback=(80, 24)):
if
columns
<=
0
or
lines
<=
0
:
try
:
size
=
os
.
get_terminal_size
(
sys
.
__stdout__
.
fileno
())
except
(
Nam
eError
,
OSError
):
except
(
Attribut
eError
,
OSError
):
size
=
os
.
terminal_size
(
fallback
)
if
columns
<=
0
:
columns
=
size
.
columns
...
...
Lib/test/test_shutil.py
View file @
5bfe0da8
...
...
@@ -1837,6 +1837,8 @@ class TermsizeTests(unittest.TestCase):
self
.
assertEqual
(
size
.
lines
,
888
)
@
unittest
.
skipUnless
(
os
.
isatty
(
sys
.
__stdout__
.
fileno
()),
"not on tty"
)
@
unittest
.
skipUnless
(
hasattr
(
os
,
'get_terminal_size'
),
'need os.get_terminal_size()'
)
def
test_stty_match
(
self
):
"""Check if stty returns the same results ignoring env
...
...
Misc/ACKS
View file @
5bfe0da8
...
...
@@ -90,6 +90,7 @@ Matthew Barnett
Richard Barran
Cesar Eduardo Barros
Des Barry
Emanuel Barry
Ulf Bartelt
Campbell Barton
Don Bashford
...
...
Misc/NEWS
View file @
5bfe0da8
...
...
@@ -245,6 +245,10 @@ Core and Builtins
Library
-------
-
Issue
#
26801
:
Fix
error
handling
in
:
func
:`
shutil
.
get_terminal_size
`,
catch
:
exc
:`
AttributeError
`
instead
of
:
exc
:`
NameError
`.
Patch
written
by
Emanuel
Barry
.
-
Issue
#
24838
:
tarfile
's ustar and gnu formats now correctly calculate name
and link field limits for multibyte character encodings like utf-8.
...
...
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