Comments (4)
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.
Could you confirm, that fix in branch Issue#6
fixed the issue?
from django-markdownx.
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.
Fixed in v1.2.1
from django-markdownx.
Related Issues (20)
- Found a possible security concern HOT 2
- No cookie with key "csrftoken". Wrong name?
- Can't type `[` or `]` using a french keyboard on Windows
- MARKDOWNX_EDITOR_RESIZABLE does not appear to work in v4
- Can't add multiline code block HOT 1
- Release for Django 4.0 HOT 2
- getCookie() bug? HOT 1
- Simple optimization inside views.py HOT 1
- AttributeError on markdownify HOT 1
- A recent Upload and markdownify path errors
- How to customize the textarea cols HOT 2
- Cross-Site Scripting (XSS) Vulnerability in Markdown Library HOT 1
- AttributeError when using pillow >=10.0
- Css for dark theme in admin page
- Contact email to report a vulnerability does not exists HOT 1
- Allow overriding the default storage class for images and such
- Load HTML in iframe?
- Editor height grows on inputs HOT 16
- Ability to set a media path per MarkdownxField
- just now fix! severity found HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-markdownx.