Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -2342,7 +2342,8 @@ def _get_log(url, user_name, password, log_file=None):
# Extra encode() and decode for stdout which does not surpport 'utf-8'
logger.warning(chunk.decode(encoding='utf-8', errors='replace')
.encode(std_encoding, errors='replace')
.decode(std_encoding, errors='replace'), end='') # each line of log has CRLF.
.decode(std_encoding, errors='replace')
.rstrip('\n\r')) # each line of log has CRLF.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.rstrip('\n\r') might remove newlines which were intentionally logged by the app, so this is probably not ideal. But I don't know what line terminator is the extra one: \n, \r, \r\n?

From what I've seen, it seems to be \n. So replacing rstrip with [:-1] should do the job, as long as it is guaranteed that there will always be a trailing newline.

r.release_conn()


Expand Down