-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have 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
Cannot create a task with 👀 character in the uploaded filename #6528
Comments
I would like to be assigned this issue |
The cause of this issue seems to be because of this line in When there are characters that are not encodable in latin-1 such as 👀 in the file name, in the response header the file name gets encoded using MIME encoding, and so retrieving the file name from the response header can lead to unexpected results. My proposed solution is to simply decode the file name in the def _maybe_append_upload_info_entry(self, filename: str):
task_data = cast(Data, self._object.data)
raw, encoding = decode_header(filename)[0]
if encoding is not None:
filename = raw.decode(encoding)
filename = self._prepare_upload_info_entry(filename)
task_data.client_files.get_or_create(file=filename) |
@nmanovic am I good to create a PR for this? |
@AndrewLuGit , please do. |
<!-- Raise an issue to propose your change (https://github.com/opencv/cvat/issues). It helps to avoid duplication of efforts from multiple independent contributors. Discuss your ideas with maintainers to be sure that changes will be approved and merged. Read the [Contribution guide](https://opencv.github.io/cvat/docs/contributing/). --> <!-- Provide a general summary of your changes in the Title above --> ### Motivation and context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. Describe your changes in detail, add screenshots. --> This fixes issue #6528, as filenames with special characters must be decoded from the MIME header back into UTF-8. ### How has this been tested? <!-- Please describe in detail how you tested your changes. Include details of your testing environment, and the tests you ran to see how your change affects other areas of the code, etc. --> ### Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. If an item isn't applicable for some reason, then ~~explicitly strikethrough~~ the whole line. If you don't do that, GitHub will show incorrect progress for the pull request. If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] I submit my changes into the `develop` branch - [x] I have created a changelog fragment <!-- see top comment in CHANGELOG.md --> - [ ] I have updated the documentation accordingly - [x] I have added tests to cover my changes - [x] I have linked related issues (see [GitHub docs]( https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword)) - [x] I have increased versions of npm packages if it is necessary ([cvat-canvas](https://github.com/opencv/cvat/tree/develop/cvat-canvas#versioning), [cvat-core](https://github.com/opencv/cvat/tree/develop/cvat-core#versioning), [cvat-data](https://github.com/opencv/cvat/tree/develop/cvat-data#versioning) and [cvat-ui](https://github.com/opencv/cvat/tree/develop/cvat-ui#versioning)) ### License - [x] I submit _my code changes_ under the same [MIT License]( https://github.com/opencv/cvat/blob/develop/LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern. --------- Co-authored-by: Andrey Zhavoronkov <[email protected]>
Fixed in #7646 |
My actions before raising this issue
Steps to Reproduce (for bugs)
Expected Behaviour
Current Behaviour
Possible Solution
Context
Your Environment
git log -1
):docker version
(e.g. Docker 17.0.05):Logs from `cvat` container
The text was updated successfully, but these errors were encountered: