db96d13453
Before the change, profanity has shown `TypeError: prof_pre_chat_message_display() missing 3 required positional arguments: 'barejid', 'resource', and 'message'` error for received messages with incorrect encoding instead of proper error handling for string convertion. That is a temporary fix, correct fix probably would be passing potentially problematic char* as `bytes` (using `y` instead of `s` format), but this would require API changes and hence correction of plugins to handle new input parameters properly (likely with "decode" function). A bit hard to reproduce. You need to add a plugin with the following code (or any other plugin with `prof_pre_chat_message_display` present, such as emoticons.py): ```python def prof_pre_chat_message_display(barejid, resource, message): return message ``` and then receive/send message with incorrectly encoded character, it can be any invalid UTF8 symbol. You'll see error in console, errors don't represent actual errors in plugins, but rather Profanity's shortcoming, though it make appear so that the problem is in plugin. Actual proper handling would likely be using `y` instead of `s` format (see [reference](https://docs.python.org/3/c-api/arg.html#c.Py_BuildValue)) > s ([str](https://docs.python.org/3/library/stdtypes.html#str) or None) [const char *] > Convert a null-terminated C string to a Python [str](https://docs.python.org/3/library/stdtypes.html#str) object using 'utf-8' encoding. If the C string pointer is NULL, None is used. to > y ([bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) [const char *] > This converts a C string to a Python [bytes](https://docs.python.org/3/library/stdtypes.html#bytes) > object. If the C string pointer is NULL, None is returned. since there is a [problem](https://docs.python.org/3/c-api/arg.html) with `s`: > s ([str](https://docs.python.org/3/library/stdtypes.html#str)) [const char *] > Convert a Unicode object to a C pointer to a character string. > A pointer to an existing string is stored in the character pointer variable whose address you pass. > ... Unicode objects are converted to C strings using 'utf-8' encoding. > **If this conversion fails**, a [UnicodeError](https://docs.python.org/3/library/exceptions.html#UnicodeError) is raised. In python such problem can be handled using `errors='ignore'` in [bytes.decode](https://docs.python.org/3/library/stdtypes.html#bytes.decode) or in a more sophisticated manner, depending on needs and realization. |
||
---|---|---|
.builds | ||
.github | ||
apidocs | ||
docs | ||
icons | ||
src | ||
tests | ||
themes | ||
.clang-format | ||
.codespellrc | ||
.git-blame-ignore-revs | ||
.gitignore | ||
bootstrap.sh | ||
Brewfile | ||
CHANGELOG | ||
ci-build.sh | ||
configure-debug | ||
configure.ac | ||
CONTRIBUTING.md | ||
COPYING | ||
Dockerfile.arch | ||
Dockerfile.debian | ||
Dockerfile.fedora | ||
Dockerfile.tumbleweed | ||
Dockerfile.ubuntu | ||
LICENSE.txt | ||
Makefile.am | ||
prof.supp | ||
profanity.doap | ||
profrc.example | ||
README.md | ||
RELEASE_GUIDE.md | ||
SECURITY.md | ||
SPONSORS.md | ||
theme_template |
Profanity
Profanity is a console based XMPP client inspired by Irssi.
If you like Profanity consider becoming a sponsor or donate some money.
See the User Guide for information on installing and using Profanity.
Project
This project is about freedom, privacy and choice. We want to enable people to chat with one another in a safe way. Thus supporting encryption (OTR, PGP, OMEMO, OX) and being decentralized, meaning everyone can run their own server. We believe XMPP is a great proven protocol with an excellent community serving this purpose well.
Feel free to follow us on twitter, join our mailing list and/or MUC.
Installation
Our user guide contains an install section and a section for building from source yourself.
Donations
We would highly appreciate it if you support us via GitHub Sponsors. Especially if you make feature requests or need help using Profanity. Sponsoring enables us to spend time on Profanity.
An alternative way to support us would be to ask for our IBAN or use Bitcoin: bc1qx265eat7hfasqkqmk9qf38delydnrnuvzhzy0x
.
Issues backed by a sponsor will be tagged with the sponsored label. Feature requests that we consider out of scope, either because of interest or because of time needed to implement them, will be marked with the unfunded label.
Another way to sponsor us or get an issue solved is to comment on an issue that you are willing to sponsor it.
Tasks from our sponsors will be tackled first.
Thank you! <3
How to contribute
We tried to sum things up on our helpout page. Additionally you can check out our blog where we have articles like: How to get a backtrace and Contributing a Patch via GitHub. For more technical details check out our CONTRIBUTING.md file.
Getting help
To get help, first read our User Guide then check out the FAQ. If you have are having a problem then first search the issue tracker. If you don't find anything there either come to our MUC or create a new issue depending on what your problem is.
Links
Website
URL: https://profanity-im.github.io
Repo: https://github.com/profanity-im/profanity-im.github.io
Blog
URL: https://profanity-im.github.io/blog
Repo: https://github.com/profanity-im/blog
Mailinglist
Mailing List: https://lists.posteo.de/listinfo/profanity
Chatroom
MUC: profanity@rooms.dismail.de
Plugins
Plugins repository: https://github.com/profanity-im/profanity-plugins