Skip to content

Python 3 support for urlparse4#14

Closed
malloxpb wants to merge 12 commits into
commonsearch:masterfrom
scrapy:py3sp
Closed

Python 3 support for urlparse4#14
malloxpb wants to merge 12 commits into
commonsearch:masterfrom
scrapy:py3sp

Conversation

@malloxpb

@malloxpb malloxpb commented Jun 7, 2018

Copy link
Copy Markdown

Hey guys, I made a python 3 support for this project. Can you take a look at it when you have a chance? 😃 #5

Comment thread setup.py
],
long_description=long_description,
ext_modules=ext_modules,
include_package_data=True

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is include_package_data=True removed on purpose?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember I got some trouble with it at the beginning but now it's resolved. Let me put it back real quick!

Comment thread urlparse4/__init__.py Outdated
from urlparse import *
import six

from six.moves.urllib.parse import urlparse, urlsplit, urljoin

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the idea behind from urlparse import * was to provide all functions from urlparse module, and then override some of them below, so this should be from six.moves.urllib.parse import * now

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got this error when importing all the modules of urllib:

NameError: name 'urlsplit' is not defined

@malloxpb malloxpb Jun 7, 2018

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I import all the functions in urllib manually?

Comment thread urlparse4/__init__.py Outdated
_original_urljoin = urljoin

from cgurl import urlsplit, urljoin
from cgurl import url_split, url_join

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this functions should override urlsplit, urljoin from urlparse, so names should stay the same

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had some ImportError before so I tried to change it as an experiment. I will put it back now 😄

@lopuhin lopuhin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@malloxpb malloxpb closed this Aug 1, 2018
@malloxpb malloxpb deleted the py3sp branch August 1, 2018 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants