Project

General

Profile

Actions

Idea #11770

open

[Python SDK] Implement support for universal newline mode in Collections API

Added by Tom Morris over 7 years ago. Updated 8 months ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
API
Target version:
Start date:
Due date:
Story points:
-
Release:
Release relationship:
Auto

Description

Implementation should match that of the Python 3 file open method as described at: https://docs.python.org/release/3.2/library/functions.html#open

??newline controls how universal newlines works (it only applies to text mode). It can be None, '', '\n', '\r', and '\r\n'. It works as follows:

On input, if newline is None, universal newlines mode is enabled. Lines in the input can end in '\n', '\r', or '\r\n', and these are translated into '\n' before being returned to the caller. If it is '', universal newline mode is enabled, but line endings are returned to the caller untranslated. If it has any of the other legal values, input lines are only terminated by the given string, and the line ending is returned to the caller untranslated.
On output, if newline is None, any '\n' characters written are translated to the system default line separator, os.linesep. If newline is '', no translation takes place. If newline is any of the other legal values, any '\n' characters written are translated to the given string.
??

Note that the Python 2 method of specifying a mode of 'rU' is now deprecated.


Related issues

Related to Arvados - Idea #11419: [SDKs] support text-mode open() in Python 3ResolvedTom Clegg03/21/2017Actions
Actions #1

Updated by Tom Morris over 7 years ago

  • Description updated (diff)
Actions #2

Updated by Tom Morris over 7 years ago

  • Subject changed from [Python SDK] Implement support for universal newline mode (rU) in Collections API to [Python SDK] Implement support for universal newline mode in Collections API
  • Description updated (diff)
Actions #3

Updated by Tom Morris over 7 years ago

  • Target version changed from 2017-06-21 sprint to Arvados Future Sprints
Actions #4

Updated by Tom Morris about 6 years ago

  • Target version changed from Arvados Future Sprints to To Be Groomed
Actions #5

Updated by Peter Amstutz over 3 years ago

  • Target version deleted (To Be Groomed)
Actions #6

Updated by Peter Amstutz over 1 year ago

  • Release set to 60
Actions #7

Updated by Peter Amstutz 8 months ago

  • Target version set to Future
Actions

Also available in: Atom PDF