[issue38503] bug: string search can find \n, but can NEVER find \r

2019-10-17 Thread Inada Naoki


Inada Naoki  added the comment:

It is "universal newline".
See
https://docs.python.org/3/library/functions.html#open
and
https://docs.python.org/3/glossary.html#term-universal-newlines

--
nosy: +inada.naoki
resolution:  -> not a bug
stage:  -> 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



[issue38503] bug: string search can find \n, but can NEVER find \r

2019-10-17 Thread wang xuancong


New submission from wang xuancong :

If I load a file which contains "\r" and "\n", I can find "\n", but not "\r". 
This behaviour is inconsistent in Python 3, but consistent in Python 2.

>>> open('./3cjkxdnw/accessibilityLog/1570181896323.csv', 
>>> 'rb').read().count(b'\r')
88
>>> open('./3cjkxdnw/accessibilityLog/1570181896323.csv').read().count('\r')
0
>>> type(open('./3cjkxdnw/accessibilityLog/1570181896323.csv').read())

>>> type('\r')


Thanks!

--
messages: 354834
nosy: xuancong84
priority: normal
severity: normal
status: open
title: bug: string search can find \n, but can NEVER find \r
type: behavior
versions: Python 3.9

___
Python tracker 

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