Giter Site home page Giter Site logo

Comments (4)

eduard-sukharev avatar eduard-sukharev commented on May 24, 2024 1

the solution from here solves the missing len attribute: as explained further in comments to another solution:

Also note that the len was removed in Python3, so you cannot use your solution in Python3.

from django-markdownx.

adi- avatar adi- commented on May 24, 2024

Could you confirm, that fix in branch Issue#6 fixed the issue?

from django-markdownx.

eduard-sukharev avatar eduard-sukharev commented on May 24, 2024

i've tried fixing it that way, but it then chokes at line 31 and says:

AttributeError at /markdownx/upload/
'_io.BytesIO' object has no attribute 'len'

Request Method: POST
Request URL: http://localhost:8000/markdownx/upload/
Django Version: 1.8.5
Python Executable: /home/kraplax/noslack/bin/python
Python Version: 3.4.0
Python Path: ['/home/kraplax/noslack/src', '/home/kraplax/pycharm-community-3.4.1/helpers/pydev', '/home/kraplax/noslack/src', '/home/kraplax/noslack/lib/python3.4', '/home/kraplax/noslack/lib/python3.4/plat-i386-linux-gnu', '/home/kraplax/noslack/lib/python3.4/lib-dynload', '/usr/lib/python3.4', '/usr/lib/python3.4/plat-i386-linux-gnu', '/home/kraplax/noslack/lib/python3.4/site-packages']
Server time: Sun, 18 Oct 2015 11:08:00 +0000
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'time_sections',
 'account',
 'markdownx',
 'ublog',
 'pinax_theme_bootstrap',
 'bootstrapform')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'account.middleware.LocaleMiddleware',
 'account.middleware.TimezoneMiddleware')

Traceback:
File "/home/kraplax/noslack/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response
  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/kraplax/noslack/lib/python3.4/site-packages/django/views/generic/base.py" in view
  71.             return self.dispatch(request, *args, **kwargs)
File "/home/kraplax/noslack/lib/python3.4/site-packages/django/views/generic/base.py" in dispatch
  89.         return handler(request, *args, **kwargs)
File "/home/kraplax/noslack/lib/python3.4/site-packages/django/views/generic/edit.py" in post
  215.             return self.form_valid(form)
File "/home/kraplax/noslack/lib/python3.4/site-packages/markdownx/views.py" in form_valid
  30.         image_path = form.save()
File "/home/kraplax/noslack/lib/python3.4/site-packages/markdownx/forms.py" in save
  32.         img = InMemoryUploadedFile(thumb_io, "image", file_name, self.files['image'].content_type, thumb_io.len, None)

Exception Type: AttributeError at /markdownx/upload/
Exception Value: '_io.BytesIO' object has no attribute 'len'
Request information:
GET: No GET data

from django-markdownx.

adi- avatar adi- commented on May 24, 2024

Fixed in v1.2.1

from django-markdownx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.