Python Forum
unicodedecodeerror:utf codec can't decode byte 0xe3 in position 1
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unicodedecodeerror:utf codec can't decode byte 0xe3 in position 1
#1
Hi
The following program runs ok in idle mode python
from tkinter import * 
from playsound import playsound
from pytube import YouTube
root=Tk()
root.title("Download vídeos do Youtube")
def descarrega():
    a=lopes.get();
    pimba=lopes.get()    
    yt = YouTube(pimba).streams.first().download()
    playsound('sineta2.mp3')
after run pyinstaller I got one exe file and I run it I got the error disctibed in the title of the post.
I try several things like

def descarrega():
    a=lopes.get();
    pimba=lopes.get()
    pimba.encode(encoding='UTF-8',errors='ignore')
    yt = YouTube(pimba).streams.first().download()
    playsound('sineta2.mp3')
But no luck. What is the solution for this error. The value of pimba is one youtube address maybe this is the problem with the enconding.
Thank you
Reply
#2
what is lopes? also post full traceback you get, in error tags
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
Photo 
Hi
lopes is the the result of one entry widget
lopes=Entry(root,fg="red",width=50)
lopes.grid(row=1,column=1)
lopes.focus_set()
I use Tkinter
Here is the error that I got

[Image: erro.jpg]

Maybe the problema is in playsound let me do some tests
Reply
#4
Sorry guys
The problem is with the line
playsound('sineta2.mp3')
because I forgot to copy this file sineta.mp3 to the app folder
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in position 562: ord ctrldan 23 4,808 Apr-24-2023, 03:40 PM
Last Post: ctrldan
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 16: invalid cont Melcu54 3 4,930 Mar-26-2023, 12:12 PM
Last Post: Gribouillis
  Decode string ? JohnnyCoffee 1 813 Jan-11-2023, 12:29 AM
Last Post: bowlofred
  [SOLVED] [Debian] UnicodeEncodeError: 'ascii' codec Winfried 1 1,023 Nov-16-2022, 11:41 AM
Last Post: Winfried
  UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 34: character Melcu54 7 18,867 Sep-26-2022, 10:09 AM
Last Post: Melcu54
  UnicodeEncodeError: 'ascii' codec can't encode character '\xfd' in position 14: ordin Armandito 6 2,721 Apr-29-2022, 12:36 PM
Last Post: Armandito
  ASCII-Codec in Python3 [SOLVED] AlphaInc 4 6,119 Jul-07-2021, 07:05 PM
Last Post: AlphaInc
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 error from Mysql call AkaAndrew123 1 3,443 Apr-28-2021, 08:16 AM
Last Post: AkaAndrew123
Question UnicodeDecodeError . . . JohnnyCoffee 5 3,545 Feb-28-2021, 02:32 AM
Last Post: JohnnyCoffee
  open(file, 'rb') raises UnicodeDecodeError binnybit 1 2,468 Sep-28-2020, 06:55 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020