Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

StdErr is wrapped as ErrorRecord producing undesired effects #3813

Copy link
Copy link
@vors

Description

@vors
Issue body actions

Steps to reproduce

Run some executable that outputs a long line to stderr and redirect it.
For example

python -c "from __future__ import print_function`nimport sys`nprint(range(100), file=sys.stderr)" *> 1

Real-life scenario that's highly impacted by that problem is searching in the logs.
When log file can be arbitrary split on the search tokens, you cannot reliable find anything in the logs.

Expected behavior

One line in the file 1

Actual behavior

Several lines in the output file.
Compare it with the redirection of stdout which works as expected.

PS /Users/svorobev/junk> python -c "from __future__ import print_function`nimport sys`nprint(range(100), file=sys.stdout)" *> 1                           
PS /Users/svorobev/junk> cat 1 | measure                                                                                                                  


Count    : 1
Average  : 
Sum      : 
Maximum  : 
Minimum  : 
Property : 



PS /Users/svorobev/junk> python -c "from __future__ import print_function`nimport sys`nprint(range(100), file=sys.stderr)" *> 1                           
PS /Users/svorobev/junk> cat 1 | measure                                                                                                                  


Count    : 3
Average  : 
Sum      : 
Maximum  : 
Minimum  : 
Property : 

Environment data

> $PSVersionTable
Name                           Value                                                                                                                     
----                           -----                                                                                                                     
PSVersion                      6.0.0-beta                                                                                                                
PSEdition                      Core                                                                                                                      
BuildVersion                   3.0.0.0                                                                                                                   
CLRVersion                                                                                                                                               
GitCommitId                    v6.0.0-beta.1                                                                                                             
OS                             Darwin 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64            
Platform                       Unix                                                                                                                      
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                   
PSRemotingProtocolVersion      2.3                                                                                                                       
SerializationVersion           1.1.0.1                                                                                                                   
WSManStackVersion              3.0 
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.