
PocsGeza
Python Testing with pytest, Second Edition: Writing out cards to command line causes UnicodeEncodingError(Page 12)
After installing the cards project card creation appears to be working but when I try to run the “card” command I get the following error:
File “C:\Users\geza.pocs\Desktop\Environments\pytest-env\pytest-env\lib\site-packages\cards\cli.py”, line 63, in list_cards
print(out.getvalue())
File “C:\Users\geza.pocs\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py”, line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: ‘charmap’ codec can’t encode characters in position 91-131: character maps to
This was repeatable on 2 different Windows installations.
First Post!

brianokken
I’m sorry you are having trouble. I’m unable to repeat the issue on the windows system I have access to.
I tried with Windows 10:
- PowerShell, Command Prompt, and Git for Windows Bash
- Python 10 and 11
Please let me know if you are still having trouble.
Popular Pragmatic topics










Other popular topics










Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /scala
- /zig
- /html
- /debian
- /nixos
- /lisp
- /agda
- /react-native
- /textmate
- /sublime-text
- /kubuntu
- /arch-linux
- /revery
- /ubuntu
- /manjaro
- /spring
- /django
- /diversity
- /nodejs
- /lua
- /slackware
- /julia
- /c
- /neovim