Skip to content

[admin] AttributeError: 'bytes' object has no attribute 'file' #13978

Open
@sentry-io

Description

@sentry-io

If the form is submitted with attaching a file, we bomb.

We should probably validate the form input as an attachment is required, or at least not hard-fail if the file hasn't been attached.

Sentry Issue: WAREHOUSE-PRODUCTION-1J0

AttributeError: 'bytes' object has no attribute 'file'
(24 additional frame(s) were not displayed)
...
  File "warehouse/sanity.py", line 76, in sanity_tween_egress
    return unicode_redirects(handler(request))
  File "warehouse/cache/http.py", line 33, in wrapped
    return view(context, request)
  File "warehouse/i18n/__init__.py", line 170, in wrapped
    return view(context, request)
  File "warehouse/metrics/views.py", line 34, in wrapper_view
    return view(context, request)
  File "warehouse/admin/views/emails.py", line 88, in email_mass
    input_file = request.params["csvfile"].file

Metadata

Metadata

Assignees

No one assigned

    Labels

    adminFeatures needed for the Admin UI (people running the site)bug 🐛

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions