GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Join GitHub todaySign upHave a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. By clicking âSign up for GitHubâ, you agree to our terms of service and privacy statement. Weâll occasionally send you account related emails. Already on GitHub? Sign in to your account Commentscommented Nov 9, 2017â¢
edited
commented Nov 9, 2017
commented Nov 10, 2017
commented Nov 11, 2017â¢
edited
commented Nov 11, 2017
added a commit that referenced this issue Nov 11, 2017commented Nov 11, 2017
commented Nov 11, 2017
commented Nov 11, 2017â¢
edited
commented Nov 12, 2017â¢
edited
changed the title
|
Had the same problem, still a bug at v0.10.212. @radoslawoska fix works. |
commented May 4, 2018
I have missed this one, thanks for bringing it back to attention. Feel free to make a PR as you've already found the fix, I'd gladly accept it and put it on pypi! |
added a commit to amrutadotorg/yagmail that referenced this issue Nov 5, 2018
csv files proper handling in the Mac mail client
referenced this issue Nov 5, 2018
Opencsv files proper handling in the Mac mail client #129
commented Nov 5, 2018
thank you, PR created |
I have got an Application/octet-stream file and want to read into memory encoded as utf-8. How can I do that with Python ?what is actually Application/octet-stream?
I have tried
But it does not work:
what I want is in alphabet
thank you very much
1 Answer
Application/octet-stream
means that the sender of the data (probably an HTTP server) had no idea what the data is. It's just an arbitrary data dump. The example output you give confirms that it's not UTF-8 since there shouldn't be any 0 bytes. It might be UTF-16-be
but then, it must be an even number of input bytes and you have 5.
That means the input data isn't valid in some way. Maybe if you speak with the person who gave it to you or which wrote the producer, that would help to find out what the data is supposed to be. Chances are it's not text at all.
Not the answer you're looking for? Browse other questions tagged pythonunicodeutf-8 or ask your own question.
Join GitHub today
Sign upHave a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking âSign up for GitHubâ, you agree to our terms of service and privacy statement. Weâll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
commented May 2, 2017
My understanding is that the Java SDK sets by default a On the other hand, I've noticed that files uploaded via AWS CLI's Uploading a file via the S3 Web console produces a I was wondering if you had any comment on this difference between |
referenced this issue May 2, 2017
Merged[MODE-2692] Return null MIME type in case of 'application/octet-stream' #1656
commented May 2, 2017
Hi don't believe the CLI actually sets Per the S3 docs, the default is |
commented May 2, 2017
Oops sorry looks like I didn't read your question close enough! I'm not sure what the exact reason is for the discrepancy but I suspect it's because |
commented May 3, 2017
Hum, if the default behavior can't be changed (what kind of 'subtle change' do you expect by the way?), what about an option to specify the default MIME type? |
commented May 3, 2017
As far as breaking change, customers may be relying on the fact that the default MIME for objects uploaded using the Java SDK to be Do you expect all of your objects to have Another option might be a custom We can also look into adding a default object MIME if that would be easiest for you. |
commented May 3, 2017
Thanks for the tips on the various methods available. |
commented May 3, 2017â¢
Are you referring to
? I was imagining just a new option like |
commented May 3, 2017
Yes, I think such an option would be useful. That would even give some API visibility to the fact that the Java SDK uses a 'non-standard' default MIME type. |
commented May 4, 2017
By the way, speaking of |
assigned dagnirMay 15, 2017
referenced this issue Jan 13, 2019
OpenCrash when guess_extension() returns None #37
I'm using Firefox 41.0.1 on Fedora 22.
I noticed this behaviour when I was trying to open a PNG image link on a GitLab site. The server replies with 'Content-Disposition:'inline; filename='logo.png'
and Content-Type:'application/octet-stream'
.
I want it to either display the image on the browser, or offer me to open it on the system default image viewer. I know it is possible, at least in Windows. See the GIF below kindly provided by @JourneymanGeek:
I made some tests using this tool and, apparently, when I click a link and the response headers contains the application/octet-stream
mime type, Firefox offers me to open the file using gedit, stating it's the default application.
- If I download the file (in this case, a PNG image) and double-click on it, it opens on Eye of Gnome.
xdg-open
also opens it in Eye of Gnome.application/octet-stream
isn't present on/usr/share/applications/defaults.list
$ grep 'gedit' /usr/share/applications/defaults.list
returns onlytext/plain=org.gnome.gedit.desktop
- I have removed the
~/.mozilla/firefox/<profile>/mimeTypes.rdf
file and the issue persits. - I have also removed the
~/.local/share/applications/mimeapps.list
file and the issue still persists. - I have restarted Firefox and logged out of my Gnome profile as well.
Here's the Firefox file association screen:
So, again, my question is: is it possible to have Firefox either display the file on the browser (if it is a file it's able of rendering), or offering the correct application able of rendering it (if there's one on the system)?
Or does the server declaring the incorrect mime-type renders it all impossible?
Also, why is it thinking gedit
is the default octet-stream
handler? Is this correct?
3 Answers
I have also removed the ~/.local/share/applications/mimeapps.list
file and the issue still persists.
There is likely another mimeapps.list
elsewhere on the system. You can go through the list here, or search through your system with one of the following commands:
or
Check for any application/octet-stream
entries in those, and either comment them out or remove them.
Application Octet Stream Files
Well, seems that Firefox will not fix this issue but I fixed it in my way removing the application/octet-stream=org.gnome.gedit.desktop
from my ~/.config/mimeapps.list
and using the add-on OpenDownload² to provide me the Run
option.
If the extension of the file being downloaded is correctly configured in the mimeapps.list
, firefox will open (run) it like a charm.
Application Octet Stream File Extension
@Bob answered part 2 of the question: how to control which app opens the file.
The answer to part 1 is: Firefox downloads all files of type application/octet-stream by design. According to the HTTP standard, a compliant browser MUST NOT second-guess the server if a content-type is specified. Since octet-stream files contain arbitrary data, the browser should download them.
Most browsers ignore the standard in favor of user friendliness. Firefox does not. As stated in @Geyslan's answer, you would need to use a 3rd party extension to circumvent this design choice.
Not the answer you're looking for? Browse other questions tagged linuxfirefoxfedoragnomemime-types or ask your own question.
My client sent me file, suppose to be Backup file of MSAccess. They are using MSAccess as database application.
The file is around 80MB. I am expecting a backup file from them.
What I got is Binary (application/octet-stream) file type. It is neither SQL nor .BAK.
I am planning to get proper backup file from them in whatever format they have. And convert whole into MySQL format. Fortunately I have trail version of Red Gate software for 14 days that converts .BAK into SQL format.
I cannot open/use Binary (application/octet-stream) file or use it to convert into MySQL. How can I achieve proper bakcup file with Binary (application/octet-stream) file type? I would appreciate any solution to achieve my goal.
How To Open Octet Stream File
1 Answer
In my case, it was a file exported from Heroku using the commands:
The file was imported into my local database using:
See the docs here.