[issue26648] csv.reader Error message indicates to use deprecated

2016-03-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

When this error is triggered at all?

--

___
Python tracker 

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



[issue26648] csv.reader Error message indicates to use deprecated

2016-03-27 Thread SilentGhost

SilentGhost added the comment:

Ah, the bit about csv module doing it's own newline handling is what I missed. 
Here is the updated patch.

--
Added file: http://bugs.python.org/file42306/issue26648_2.diff

___
Python tracker 

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



[issue26648] csv.reader Error message indicates to use deprecated

2016-03-27 Thread Martin Panter

Martin Panter added the comment:

Isn’t using newline=None a way to produce the error in the first place? Silent 
Ghost: see the footnote .

Reading with newline=None translates newlines. Writing with newline=None 
produces CRLFs on Windows. I understand the CSV module wants neither of these 
translations, so it has full control of the code points.

--
nosy: +martin.panter

___
Python tracker 

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



[issue26648] csv.reader Error message indicates to use deprecated

2016-03-27 Thread SilentGhost

SilentGhost added the comment:

While the 'U' mode has been deprecated it doesn't mean that your example 
doesn't run in 3.5 - it runs just fine and will keep doing so until 4.0

I'm attaching patch that suggests using newline=None (even though it's a 
default value for open), as that what seems to better correspond to the old 'U' 
mode.

--
components: +Extension Modules
keywords: +patch
nosy: +SilentGhost, serhiy.storchaka
stage:  -> patch review
type: enhancement -> behavior
versions: +Python 3.6 -Python 3.5
Added file: http://bugs.python.org/file42304/issue26648.diff

___
Python tracker 

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



[issue26648] csv.reader Error message indicates to use deprecated

2016-03-26 Thread Philip Martin

New submission from Philip Martin:

Currently, the error message:

_csv.Error: new-line character seen in unquoted field - do you need to open the 
file in universal-newline mode?

is cryptic in that universal line mode has been deprecated, and will not run in 
Python 3.5., i.e.:
open(escape_path, "rU", encoding=ENCODING)
>>> DeprecationWarning: 'U' mode is deprecated

I think a message indicating a suggestion to open the file with newline='' to 
enable universal line mode is more insightful.

--
messages: 262502
nosy: Philip Martin
priority: normal
severity: normal
status: open
title: csv.reader Error message indicates to use deprecated
type: enhancement
versions: Python 3.5

___
Python tracker 

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