[issue19479] textwrap.dedent doesn't work properly with strings containing CRLF

2022-01-20 Thread Georg Brandl


Change by Georg Brandl :


--
nosy:  -georg.brandl

___
Python tracker 

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



[issue19479] textwrap.dedent doesn't work properly with strings containing CRLF

2022-01-20 Thread Irit Katriel


Change by Irit Katriel :


--
type: behavior -> enhancement
versions: +Python 3.11 -Python 2.7, Python 3.3

___
Python tracker 

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



[issue19479] textwrap.dedent doesn't work properly with strings containing CRLF

2017-06-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm not sure that textwrap.dedent() should support the CRLF line separator. 
Usually the conversion between different line separators (CRLF, CR, LF) used in 
in external files and LF used internally is done at I/O level.

In any case this looks to me like rather a new feature than a bug fix.

--
nosy: +ncoghlan, pitrou, serhiy.storchaka

___
Python tracker 

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



[issue19479] textwrap.dedent doesn't work properly with strings containing CRLF

2017-06-26 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Emily, do you have any opinion on the issue?  The complaint seems plausible, 
but I have not looked at the docs, nor the code to understand the import of '[^ 
\t\n]' (re for 'anything but space, tab, newline') matches '\r'.

Alexis, you must sign the PSF contributor license agreement,
https://www.python.org/psf/contrib/
before we can use your patch.

--

___
Python tracker 

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



[issue19479] textwrap.dedent doesn't work properly with strings containing CRLF

2017-06-26 Thread Emily Morehouse

Emily Morehouse added the comment:

@georg.brandl and @terry.reedy, this issue was mentioned again recently 
(http://bugs.python.org/issue30754). 

Would you like to revisit it?

--
nosy: +emilyemorehouse

___
Python tracker 

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



[issue19479] textwrap.dedent doesn't work properly with strings containing CRLF

2013-11-08 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
nosy: +georg.brandl, terry.reedy

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



[issue19479] textwrap.dedent doesn't work properly with strings containing CRLF

2013-11-06 Thread Alexis Daboville

Alexis Daboville added the comment:

Added patch.

--
keywords: +patch
Added file: http://bugs.python.org/file32519/dedent.patch

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



[issue19479] textwrap.dedent doesn't work properly with strings containing CRLF

2013-11-02 Thread Alexis Daboville

New submission from Alexis Daboville:

If a string contains an empty line and is using CRLF newlines instead of LF 
newlines textwrap.dedent doesn't work properly: it returns the original string 
w/o dedenting it.

As far as I can tell it's because it considers the empty string to be the 
longest common indent 
(http://hg.python.org/cpython/file/2.7/Lib/textwrap.py#l372, '[^ \t\n]' matches 
'\r').

Expected behavior: textwrap.dedent should work the same way whether lines are 
separated by a single LF character or by CRLF.

To repro:

 ✓ 15:26 dabovill @ morag in /tmp/dedent $ cat dedent.py
import textwrap

lf = '\ta\n\tb\n\n\tc'
crlf = '\ta\r\n\tb\r\n\r\n\tc'

print('- lf')
print(lf)
print('- dedent(lf)')
print(textwrap.dedent(lf))
print('- crlf')
print(crlf)
print('- dedent(crlf)')
print(textwrap.dedent(crlf))
 ✓ 15:26 dabovill @ morag in /tmp/dedent $ python2.7 dedent.py
- lf
a
b

c
- dedent(lf)
a
b

c
- crlf
a
b

c
- dedent(crlf)
a
b

c
 ✓ 15:26 dabovill @ morag in /tmp/dedent $ python3.3 dedent.py
- lf
a
b

c
- dedent(lf)
a
b

c
- crlf
a
b

c
- dedent(crlf)
a
b

c

--
components: Library (Lib)
messages: 201975
nosy: alexis.d
priority: normal
severity: normal
status: open
title: textwrap.dedent doesn't work properly with strings containing CRLF
type: behavior
versions: Python 2.7, Python 3.3

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