Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions httpie/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ def devnull(self) -> IO:
self._devnull = open(os.devnull, 'w+')
return self._devnull

@devnull.setter
def devnull(self, value):
self._devnull = value

def log_error(self, msg, level='error'):
assert level in ['error', 'warning']
self._orig_stderr.write(f'\n{self.program_name}: {level}: {msg}\n\n')
13 changes: 2 additions & 11 deletions httpie/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Download mode implementation.

"""
import errno
import mimetypes
import os
import re
Expand Down Expand Up @@ -150,16 +149,8 @@ def trim_filename(filename: str, max_len: int) -> str:

def get_filename_max_length(directory: str) -> int:
max_len = 255
try:
pathconf = os.pathconf
except AttributeError:
pass # non-posix
else:
try:
max_len = pathconf(directory, 'PC_NAME_MAX')
except OSError as e:
if e.errno != errno.EINVAL:
raise
if hasattr(os, 'pathconf') and 'PC_NAME_MAX' in os.pathconf_names:
max_len = os.pathconf(directory, 'PC_NAME_MAX')
return max_len


Expand Down
4 changes: 2 additions & 2 deletions httpie/output/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def write_message(
}
try:
if env.is_windows and 'colors' in args.prettify:
write_stream_with_colors_win_py3(**write_stream_kwargs)
write_stream_with_colors_win(**write_stream_kwargs)
else:
write_stream(**write_stream_kwargs)
except OSError as e:
Expand Down Expand Up @@ -69,7 +69,7 @@ def write_stream(
outfile.flush()


def write_stream_with_colors_win_py3(
def write_stream_with_colors_win(
stream: 'BaseStream',
outfile: TextIO,
flush: bool
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def test_session_unicode(self, httpbin):
httpbin.url + '/get', env=self.env())
assert HTTP_OK in r2

# FIXME: Authorization *sometimes* is not present on Python3
# FIXME: Authorization *sometimes* is not present
assert (r2.json['headers']['Authorization']
== HTTPBasicAuth.make_header('test', UNICODE))
# httpbin doesn't interpret utf8 headers
Expand Down