msg344397 - (view) |
Author: Bruce Merry (bmerry) * |
Date: 2019-06-03 09:32 |
Text-based protocols sometimes allow a choice of newline separator - I work with one that allows either \r or \n. Unfortunately that doesn't work with StreamReader.readuntil, which only accepts a single separator, so I've had to do some hacky things to obtain lines without having to From discussion in issue 32052, it sounded like extending StreamReader.readuntil to support a tuple of separators would be feasible. |
|
|
msg344398 - (view) |
Author: Andrew Svetlov (asvetlov) *  |
Date: 2019-06-03 10:00 |
Would you make a PR? I guess to modify Stream.readuntil() StreamReader is deprecated, I'm not sure if we should add new functionality to this class. |
|
|
msg344399 - (view) |
Author: Bruce Merry (bmerry) * |
Date: 2019-06-03 10:06 |
I wasn't aware of that deprecation - it doesn't seem to be mentioned at https://docs.python.org/3.8/library/asyncio-stream.html. What is the replacement? |
|
|
msg344403 - (view) |
Author: Andrew Svetlov (asvetlov) *  |
Date: 2019-06-03 10:26 |
Docs will be updated soon. The change has landed a week ago, I had no time for docs update before 3.8 beta. Sorry for that. The idea is: StreamReader and StreamWriter are merged into just Stream, open_connection() is replaced with connect() etc. |
|
|
msg344404 - (view) |
Author: Bruce Merry (bmerry) * |
Date: 2019-06-03 10:28 |
Ok. Does the new Stream still have a similar interface for readuntil i.e. is this still a relevant request against the new API? I'm happy to let deprecated APIs stay as-is. |
|
|
msg344405 - (view) |
Author: Andrew Svetlov (asvetlov) *  |
Date: 2019-06-03 10:33 |
Yes, Stream supports all StreamReader and StreamWriter methods |
|
|
msg344409 - (view) |
Author: Bruce Merry (bmerry) * |
Date: 2019-06-03 10:38 |
Ok, I've changed the issue title to refer to Stream. Since this would be a new feature, I assume it's off the table for 3.8, but I'll see if I get time to implement a PR in time for 3.9 (and get someone at work to sign off on the contributor agreement, which might be the harder part). Thanks for the quick and helpful responses. |
|
|
msg352089 - (view) |
Author: Bruce Merry (bmerry) * |
Date: 2019-09-12 10:20 |
I finally have permission from my employer to sign the contributors agreement, so I'll take a stab at this when I have some free time (unless nobody else gets to it first). |
|
|
msg352179 - (view) |
Author: Andrew Svetlov (asvetlov) *  |
Date: 2019-09-12 14:34 |
please do |
|
|
msg353323 - (view) |
Author: Bruce Merry (bmerry) * |
Date: 2019-09-26 16:09 |
I've submitted a PR: https://github.com/python/cpython/pull/16429 |
|
|
msg353335 - (view) |
Author: Yury Selivanov (yselivanov) *  |
Date: 2019-09-26 19:48 |
I already mentioned that in the PR, but we'll have to hit a pause on this. We decided to revert the latest streams implementation from 3.8, see https://bugs.python.org/issue38242. The upshot is that what we have in 3.9 should be more amenable for things like this one. |
|
|