Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-34533: Apply PEP384 to _csv module #8977

Closed
wants to merge 8 commits into from
Closed

bpo-34533: Apply PEP384 to _csv module #8977

wants to merge 8 commits into from

Conversation

eduardo-elizondo
Copy link
Contributor

@eduardo-elizondo eduardo-elizondo commented Aug 28, 2018

@ZackerySpytz
Copy link
Contributor

ZackerySpytz commented Aug 28, 2018

You should ensure the build actually succeeds and the tests pass before you submit a PR (see also the developer's guide).

Be aware that I'm preparing to submit a PR applying this refactoring to the _ssl module (based on the old patch at https://bugs.python.org/issue15670).

Also, the issue that you created on the tracker happens to be a duplicate of https://bugs.python.org/issue14935.

@eduardo-elizondo
Copy link
Contributor Author

@ZackerySpytz Sorry about that, contbuild is passing now!

There was an incorrect assumption on one of the csv modules test. Given that Dialect class is a HeapType now, it should be able to be pickled when proto == 0 or 1.

Also, good point. I didn't see that previous issue. Given that the other one has been there for 6+ years, we can probably just take this one :)

Modules/_csv.c Outdated
@@ -45,9 +45,10 @@ _csv_free(void *m)
_csv_clear((PyObject *)m);
}

static struct PyModuleDef _csvmodule;
static struct PyModuleDef _csvmodule_def;
static PyObject *_csvmodule;
Copy link

Choose a reason for hiding this comment

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

Do we need this at file scope? Given that this is replacing PyObject *module at line 1618

Copy link
Contributor Author

Choose a reason for hiding this comment

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

_csvmodule_def is required in _csvstate_global. But you are right, we don't need _csvmodule at file scope. Will fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants