Commit Graph

12 Commits

Author SHA1 Message Date
Jelle Zijlstra
5d553c9584 apply black and isort (#4287)
* apply black and isort

* move some type ignores
2020-06-28 13:31:00 -07:00
Rune Tynan
fcdfacf944 Fix stubtest failures for socketserver on windows (#4103) 2020-05-27 19:34:35 +02:00
Philipp Hahn
84147ec9cb sockeserver: Add undocumented internals (#3924)
the `rfile` and `wfile` members are already implemented by
StreamRequestHandler. In addition to them several (undocumented)
class and instance variables exist according to
<https://github.com/python/cpython/blob/master/Lib/socketserver.py#L742>:
- `rbufsize`
- `wbufsize`
- `timeout`
- `disable_nagle_algorithm`
- `packet` and `socket` for datagrams

The already exist with Python 2.7
<https://github.com/python/cpython/blob/2.7/Lib/SocketServer.py#L677>

```mermaid
classDiagram
BaseRequestHandler <|-- DatagramRequestHandler
BaseRequestHandler <|-- StreamRequestHandler
StreamRequestHandler <|-- BaseHTTPRequestHandler
```
2020-04-14 13:22:40 -07:00
Wolf Honore
211aec7b22 socketserver: Add missing attributes and methods for ForkingMixIn and ThreadingMixin (#3672)
* Add missing attributes and methods for ForkingMixIn and ThreadingMixin

* Copy socketserver.py to SocketServer.py

* Fix type of timeout
2020-02-01 09:30:43 -08:00
Faidon Liambotis
d87a4ffe0b socketserver.BaseRequestHandler: add missing hint (#3524)
Add hint for __init__().

Fixes #3523.
2020-01-03 08:48:49 -08:00
Benjamin Peterson
23c531df5a Type socketserver's RequestHandlerClass as a callable. (#3422)
It's not uncommon to pass functions rather than actual types into the servers.
2019-11-25 20:18:17 -08:00
Michael Lee
b294782183 Make most contextmanager __exit__ signatures return Optional[bool] (#3179)
This pull request is a follow-up to https://github.com/python/mypy/issues/7214.

In short, within that mypy issue, we found it would be helpful to
determine between contextmanagers that can "swallow" exceptions vs ones
that can't. This helps prevent some false positive when using flags that
analyze control flow such as `--warn-unreachable`. To do this,
Jelle proposed assuming that only contextmanagers where the `__exit__`
returns `bool` are assumed to swallow exceptions.

This unfortunately required the following typeshed changes:

1. The typing.IO, threading.Lock, and concurrent.futures.Executor
   were all modified so `__exit__` returns `Optional[None]` instead
   of None -- along with all of their subclasses.

   I believe these three types are meant to be subclassed, so I felt
   picking the more general type was correct.

2. There were also a few concrete types (e.g. see socketserver,
   subprocess, ftplib...) that I modified to return `None` -- I checked
   the source code, and these all seem to return None (and don't appear
   to be meant to be subclassable).

3. contextlib.suppress was changed to return bool. I also double-checked
   the unittest modules and modified a subset of those contextmanagers,
   leaving ones like `_AssertRaisesContext` alone.
2019-08-16 16:13:33 -07:00
Niels Buwen
5638d29203 Fix #3187 : Wrong Signatures in socketserver (#3189)
Fixes #3187
2019-08-16 17:08:23 +02:00
Michael Lee
efb67946f8 Use variable annotations everywhere (#2909) 2019-04-13 10:40:52 +02:00
Yusuke Miyazaki
6192cce9d9 Avoid using string literals in type annotations (#2294) 2018-07-02 20:23:29 -07:00
Ethan Smith
e9600db2ec Remove symlinks! (#2132) 2018-05-15 15:18:59 -04:00
Guido van Rossum
cb97bb54c0 Move 2.7 to 2 (#635)
Closes #579.
2016-10-26 16:24:49 -07:00