Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9177655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:22:32+00:00 2026-06-17T17:22:32+00:00

when retrieving a file to save it from gmail, I get the following error

  • 0

when retrieving a file to save it from gmail, I get the following error message:

Traceback (most recent call last):
  File "C:\a.py", line 32, in on_hello
    if getmail(self):
  File "C:\a.py", line 96, in getmail
    fp = open(att_path, 'wb')
IOError: [Errno 22] invalid mode ('wb') or filename: '.\\=?iso-8859-1?Q?CC_GM=5F
Est=E1vel.xlsx?='

Now, I suspect that =?iso-8859-1?Q?CC_GM=5FEst=E1vel.xlsx?= is the problem, how can I convert it to ansii? I tried using all sorts of .decode and .encode combinations with no success.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:22:33+00:00Added an answer on June 17, 2026 at 5:22 pm

    You are looking at a Quoted-printable encoding (a variant as used in MIME email headers, called encoded-word). The email.header module handles this for you:

    >>> from email.header import decode_header
    >>> for part in decode_header('=?iso-8859-1?Q?CC_GM=5FEst=E1vel.xlsx?='):
    ...     value = str(*part)
    ...     print(value)
    ...
    CC GM_Estável.xlsx
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm retrieving a file from a database server and allowing the user to download
I'm working on a GWT app where I'm retrieving a file from a web
I am familiar with the approach of retrieving a single file version from a
I am writing a script that is retrieving information from file places.sqlite (history) and
We have a flash retrieving information from an XML file. Right now we are
This Ajax is not retrieving any information from its' PHP file as it should,
I have developed a VB.Net code for retrieving data from excel file .I load
This is user.php: include(databse.php);//retrieving successfully first name and lastname from databse file into user.php
I am retrieving a jpg file from an oracle db, and trying to output
I'm retrieving a file from a FTP Server. The file is encoded as UTF-8

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.