[issue31366] Missing terminator option when using readline with socketserver.StreamRequestHandler

2017-09-06 Thread Thomas Feldmann

New submission from Thomas Feldmann:

When using `socketserver.StreamRequestHandler` it should be possible to specify 
the newline terminator that is passed to `self.connection.makefile()`.

This would be greatly appreciated by many people who have to work with network 
packets ending with `\0`.

--
components: Library (Lib)
messages: 301474
nosy: Thomas Feldmann
priority: normal
severity: normal
status: open
title: Missing terminator option when using readline with 
socketserver.StreamRequestHandler
type: enhancement

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31366>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25926] problems with "times" keyword in itertools.repeat

2015-12-22 Thread Thomas Feldmann

New submission from Thomas Feldmann:

According to the docs `itertools.repeat(object[, times])` is equivalent to

```
def repeat(object, times=None):
# repeat(10, 3) --> 10 10 10
if times is None:
while True:
yield object
else:
for i in range(times):
yield object
```

But it raises a TypeError when used this way:

```
Python 3.5.1 (default, Dec 10 2015, 10:34:07)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from itertools import repeat
>>> repeat('x', times=None)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'NoneType' object cannot be interpreted as an integer
```

The `times` keyword can be omitted but not explicitly set to None.
I checked with Python Versions 2.7 and 3.5.1 on Mac OS X and Windows 10.

------
components: Interpreter Core
messages: 256847
nosy: Thomas Feldmann
priority: normal
severity: normal
status: open
title: problems with "times" keyword in itertools.repeat
type: behavior
versions: Python 2.7, Python 3.5

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25926>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com