#5465 closed defect (fixed)
Python 3: Home page error if more than a single page of media items
Reported by: | Ben Sturmfels | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | programming | Keywords: | python3 |
Cc: | Parent Tickets: |
Description
I upgraded a MediaGoblin instance with more than 30 media items to Python 3.4 and got the following error when attempting to load the home page:
File "/home/ben/work/ws/mediagoblin/mediagoblin/tools/pagination.py", line 110, in get_page_url_explicit base_url, urllib.urlencode(new_get_params)) AttributeError: 'module' object has no attribute 'urlencode'
Loads fine under Python 2, or with 30 or less media items on Python 3 (only one page).
Attachments (1)
Change History (8)
comment:1 by , 8 years ago
Owner: | set to |
---|---|
Status: | new → in_progress |
comment:2 by , 8 years ago
Owner: | removed |
---|---|
Status: | in_progress → review |
comment:3 by , 8 years ago
Ok, so the appropriate git command/URLs will, I think, be:
git fetch https://gitlab.com/Sturm/mediagoblin.git python3-pagination
I've tested that without the fix, the new tests pass on Python 2.7 and fail on Python 3.4. When fix is applied, tests pass on both Python 2.7 and 3.4.
comment:4 by , 8 years ago
I've updated the above repository with further Paginator tests, which I believe will then allow us to close both this ticket and #55 "Paginator needs tests". Will attach a patch file too.
comment:6 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | review → closed |
comment:7 by , 8 years ago
Hi Breton,
What are your thoughts on porting this patch to stable? Anyone trying to upgrade/start a new site in Python 3 is going to be bitten by this, and it's likely they'll be running stable rather than master.
(Just ran into it on my own production site.)
I've added fix here:
https://gitlab.com/Sturm/mediagoblin/tree/python3-pagination
(This is the webpage representing a a GitLab branch called "python3-pagination". I don't think you can just
git fetch
from that though. Will do some more hunting.)