[issue31659] ssl module should not use textwrap for wrapping PEM format.

2019-02-21 Thread Inada Naoki


Change by Inada Naoki :


--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31659] ssl module should not use textwrap for wrapping PEM format.

2017-10-02 Thread Christian Heimes

Change by Christian Heimes :


--
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31659] ssl module should not use textwrap for wrapping PEM format.

2017-10-02 Thread INADA Naoki

Change by INADA Naoki :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31659] ssl module should not use textwrap for wrapping PEM format.

2017-10-02 Thread INADA Naoki

INADA Naoki  added the comment:


New changeset b75a228af8c0553aef44e4e03763af90fbc8737f by INADA Naoki in branch 
'master':
bpo-31659: Use simple slicing to format PEM cert (GH-3849)
https://github.com/python/cpython/commit/b75a228af8c0553aef44e4e03763af90fbc8737f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31659] ssl module should not use textwrap for wrapping PEM format.

2017-10-01 Thread INADA Naoki

INADA Naoki  added the comment:

For the record, this is part of `import requests`.
`import ssl` took 11 ms and `textwrap` weights 2.4 ms of it.

- ipaddress 2048 us (self 2048 us)
- textwrap 2402 us (self 2402 us)
- _ssl 2744 us (self 2744 us)
- _struct 232 us (self 232 us)
  - struct 411 us (self 180 us)
  - binascii 272 us (self 272 us)
- base64 997 us (self 315 us)
  - ssl 11158 us (self 2969 us)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31659] ssl module should not use textwrap for wrapping PEM format.

2017-10-01 Thread INADA Naoki

Change by INADA Naoki :


--
keywords: +patch
pull_requests: +3829
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31659] ssl module should not use textwrap for wrapping PEM format.

2017-10-01 Thread INADA Naoki

Change by INADA Naoki :


--
components: +Library (Lib)
versions: +Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31659] ssl module should not use textwrap for wrapping PEM format.

2017-10-01 Thread INADA Naoki

New submission from INADA Naoki :

Current DER_cert_to_PEM_cert() uses textwrap like this:

def DER_cert_to_PEM_cert(der_cert_bytes):
"""Takes a certificate in binary DER format and returns the
PEM version of it as a string."""

f = str(base64.standard_b64encode(der_cert_bytes), 'ASCII', 'strict')
return (PEM_HEADER + '\n' +
textwrap.fill(f, 64) + '\n' +
PEM_FOOTER + '\n')

But textwrap is designed to break lines at word boundary.
So textwrap.fill for base64 text may be slow.

And `import textwrap` is little slow too.

We can use simple slicing instead of textwrap.

--
messages: 303505
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: ssl module should not use textwrap for wrapping PEM format.

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com