You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tools/Scripts/crlf.py needs updating for python 3+ #56241
C:\Python32\python.exe C:/pydev/zob/zobtest.py
Traceback (most recent call last):
File "C:/pydev/zob/zobtest.py", line 134, in <module>
x()
File "C:/pydev/zob/zobtest.py", line 126, in xif'\0'in data:
TypeError: Type str doesn't support the buffer API
Process finished with exit code 1
===================================================================
Removing the test for "\0" produces this:
===================================================================
C:\Python32\python.exe C:/pydev/zob/zobtest.py
Traceback (most recent call last):
File "C:/pydev/zob/zobtest.py", line 131, in <module>
x()
File "C:/pydev/zob/zobtest.py", line 126, in x
newdata = data.replace("\r\n", "\n")
TypeError: expected an object with the buffer interface
Process finished with exit code 1
===================================================================
Activity
stephenferg commentedon May 8, 2011
I think this is a consequence of the new Unicode support in Python 3+
Here is code copied from C:\Python32\Tools\Scripts\crlf.py (on windows)
==================================================================
===================================================================
When run, it produces this (run under the PyCharm debugger)
===================================================================
Process finished with exit code 1
===================================================================
Removing the test for "\0" produces this:
===================================================================
Process finished with exit code 1
===================================================================
python-dev commentedon May 8, 2011
New changeset f94d74c85dcb by Victor Stinner in branch 'default':
Close bpo-12032: Fix scripts/crlf.py for Python 3
http://hg.python.org/cpython/rev/f94d74c85dcb
[-]Tools/Scripts/crlv.py needs updating for python 3+[/-][+]Tools/Scripts/crlf.py needs updating for python 3+[/+]merwok commentedon Aug 8, 2011
This needs porting to 3.2.
python-dev commentedon Aug 12, 2011
New changeset 47ffb957921d by Éric Araujo in branch '3.2':
Update crlf and lfcr scripts for 3.x bytes semantics (bpo-12032).
http://hg.python.org/cpython/rev/47ffb957921d