# Type checkers complain about io.text\_encoding()

**URL:** <https://discuss.python.org/t/type-checkers-complain-about-io-text-encoding/37187>\
**Category:** Python Help\
**Tags:** typing\
**Created:** [October 26, 2023, 8:20am UTC](https://discuss.python.org/t/type-checkers-complain-about-io-text-encoding/37187 "2023-10-26T08:20:30Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![ntessore](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/ntessore/32/10786_2.png) [@ntessore](https://discuss.python.org/u/ntessore)\
**Post date:** [October 26, 2023, 8:20am UTC](https://discuss.python.org/t/type-checkers-complain-about-io-text-encoding/37187/1 "2023-10-26T08:20:30Z")

</div>

I’m sure I am doing something silly, but neither mypy nor pyright recognise that `io.text_encoding()` exists. Any pointers?

```console
% python -c "import io; io.text_encoding(None)"
% mypy -c "import io; io.text_encoding(None)"  
<string>:1: error: Module has no attribute "text_encoding" [attr-defined]
Found 1 error in 1 file (checked 1 source file)

```

---

_[View the full topic](https://discuss.python.org/t/type-checkers-complain-about-io-text-encoding/37187)._
