question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mediafileupload has no attribute '_fd'

See original GitHub issue

Environment details

  • OS: Ubuntu 18.04
  • Python version: 3.7.4
  • pip version: 19.2.3
  • google-api-python-client version: current

Steps to reproduce

  1. Add simple file upload from example to quickstart example from https://developers.google.com/drive/api/v3/quickstart/python
  2. After running console shows error: attributeerror ‘mediafileupload’ object has no attribute ‘_fd’

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
busunkim96commented, Jan 14, 2020

👍 I’m able to replicate it if I misspell the filename.

1reaction
Stormwakercommented, Jan 14, 2020

I’ve noticed that there was a typo in the path to photo I wanted to upload. So I think that the error might be coming from exception handling. Full error reads:

Exception ignored in: <function MediaFileUpload.__del__ at 0x7fe736c88d40>
Traceback (most recent call last):
  File "/home/maccutkiewicz/anaconda3/lib/python3.7/site-packages/googleapiclient/http.py", line 567, in __del__
    self._fd.close()
AttributeError: 'MediaFileUpload' object has no attribute '_fd'
Read more comments on GitHub >

github_iconTop Results From Across the Web

I keep getting a 'MediaFileUpload' object has no attribute '_fd ...
I keep getting a 'MediaFileUpload' object has no attribute '_fd' error when I try uploading a file to Google Drive.
Read more >
Error Occurred while executing python google drive v3 api
I got the same error while executing MediaFileUpload(). ... _fd.close() AttributeError: 'MediaFileUpload' object has no attribute '_fd'.
Read more >
googleapiclient.http.MediaFileUpload - Google APIs
Construct a MediaFileUpload and pass as the media_body parameter of the method. For example, if we had a service that allowed uploading images:...
Read more >
AttributeError: 'FileUpload' object has no attribute 'value'
I've created an empty /data/ directory, for the sake or trying to identify what is going on. Before it was giving another error,...
Read more >
Python Examples of apiclient.http.MediaFileUpload
def upload_video(self, options: dict): """ Options is Dict with file - filepath ... body=body, media_body=MediaFileUpload(options.get('file'), chunksize=-1, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found