Skip to content

Commit f1a42e5

Browse files
committed
Deal with a type issue (and solve another)
python/mypy#13627 now causes spurious errors involving numpy but another type issue is solved.
1 parent f75ac42 commit f1a42e5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

csvbase/web.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1087,10 +1087,7 @@ def byte_buf_to_str_buf(byte_buf: UserSubmittedBytes) -> codecs.StreamReader:
10871087
logger.warning("unable to detect charset, assuming utf-8")
10881088
encoding = "utf-8"
10891089
Reader = codecs.getreader(encoding)
1090-
# FIXME: the issue here seems to be that StreamReader is typed to want
1091-
# specifically an IO[bytes] but will actually work with other things that
1092-
# are file-like enough
1093-
return Reader(byte_buf) # type: ignore
1090+
return Reader(byte_buf)
10941091

10951092

10961093
def set_current_user_for_session(user: User, session: Optional[Any] = None) -> None:

mypy.ini

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
[mypy]
2-
python_version = 3.7
2+
# work around https://github.com/python/mypy/issues/13627
3+
# (3.7 would be preferred)
4+
python_version = 3.8
5+
36
plugins = sqlmypy
47
check_untyped_defs = True
58
no_implicit_optional = True

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"black==22.3.0",
99
"bpython~=0.22.1",
1010
"feedparser==6.0.2",
11-
"mypy==0.910",
11+
"mypy==0.982",
1212
"pandas==1.3.5",
1313
"pytest-flask==1.2.0",
1414
"pytest==7.1.1",

0 commit comments

Comments
 (0)