paste icon indicating copy to clipboard operation
paste copied to clipboard

lint: ErrorWrapper.write: remove assertion

Open blueyed opened this issue 7 years ago • 2 comments

With webpy non-bytes might arrive here, via:

print(traceback.format_exc(), file=web.debug)
out = ctx.environ['wsgi.errors']
out.write(x)

I think this is legitimate, and paste should not cause more trouble (i.e. a new exception) in this case.

blueyed avatar Dec 11 '18 09:12 blueyed

Codecov Report

Merging #18 into master will decrease coverage by <.01%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #18      +/-   ##
==========================================
- Coverage   53.52%   53.52%   -0.01%     
==========================================
  Files         125      125              
  Lines       14758    14757       -1     
  Branches     2501     2501              
==========================================
- Hits         7899     7898       -1     
- Misses       6307     6308       +1     
+ Partials      552      551       -1
Flag Coverage Δ
#py27 52.38% <ø> (-0.05%) :arrow_down:
#py35 51.78% <ø> (-0.05%) :arrow_down:
#py36 51.78% <ø> (-0.05%) :arrow_down:
#py37 51.81% <ø> (-0.01%) :arrow_down:
#pypy 51.64% <ø> (-0.05%) :arrow_down:
Impacted Files Coverage Δ
paste/lint.py 82.32% <ø> (-0.1%) :arrow_down:
paste/session.py 75% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5015532...804aeb8. Read the comment docs.

codecov-io avatar Dec 11 '18 09:12 codecov-io

Have a look at https://bitbucket.org/ianb/paste/commits/ab9e5d22ad48eb70db8ef6cbc726ae809c397118 which appears to have made a bad interpretation of pep 3333:

Search 'wsgi.errors' in https://www.python.org/dev/peps/pep-3333/

Instead of removing the assertion (thus removing any linting), consider putting a version of the old code back: assert type(s) is type("")

cdent avatar Dec 11 '18 11:12 cdent