Ticket #4246 enhancement closed duplicate

Opened 4 years ago

Last modified 3 years ago

Port _c_urlarg to 3.1

Reported by: loewis Owned by: loewis
Priority: normal Milestone: Python-3.x
Component: core Keywords: py3k
Cc: spiv, thijs Branch: branches/c-urlarg-4246
(diff, github, buildbot, log)
Author: thijs Launchpad Bug:

Description (last modified by thijs) (diff)

This patch makes the _c_urlarg module work with both 2.x and 3.x. The patch depends on #4244 and #4245 being accepted.

Attachments

urlarg_3k.diff Download (2.1 KB) - added by loewis 4 years ago.
4246.feature Download (432 bytes) - added by loewis 4 years ago.

Change History

Changed 4 years ago by loewis

1

  Changed 4 years ago by loewis

  • keywords py3k added

2

  Changed 4 years ago by spiv

  • keywords py3k, review added; py3k removed
  • cc spiv added

3

  Changed 4 years ago by spiv

(In [28105]) Merge curlarg-drop-cstringio-4245: Drop usage of cStringIO in _c_urlarg.c

Author: loewis Reviewer: spiv Fixes: #4245 Refs: #4246

Drop usage of cStringIO in _c_urlarg in favour of building (and resizing) a PyString directly.

Thanks to martin@… for the patch.

4

  Changed 4 years ago by loewis

  • owner glyph deleted

Changed 4 years ago by loewis

5

  Changed 4 years ago by thijs

  • cc thijs added
  • status changed from new to assigned
  • owner set to thijs
  • keywords py3k added; py3k, review removed
  • milestone set to Python-3.x

6

  Changed 4 years ago by thijs

  • branch set to branches/c-urlarg-4246
  • branch_author set to thijs

(In [28141]) Branching to 'c-urlarg-4246'

7

  Changed 4 years ago by thijs

(In [28143]) Apply urlarg_3k.diff by loewis, refs #4246

8

  Changed 4 years ago by thijs

Build results for Python 2.6.4 on OSX 10.6 look good:

building 'twisted.protocols._c_urlarg' extension
creating build/temp.macosx-10.5-fat3-2.6/twisted/protocols
gcc -arch ppc -arch i386 -arch x86_64 -isysroot / -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include/python2.6 -c twisted/protocols/_c_urlarg.c -o build/temp.macosx-10.5-fat3-2.6/twisted/protocols/_c_urlarg.o
gcc -arch ppc -arch i386 -isysroot / -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386 -arch x86_64 -bundle -undefined dynamic_lookup build/temp.macosx-10.5-fat3-2.6/twisted/protocols/_c_urlarg.o -o build/lib.macosx-10.5-fat3-2.6/twisted/protocols/_c_urlarg.so

9

  Changed 4 years ago by thijs

(In [28147]) Make print compatible with python 3.1, refs #4246

10

follow-up: ↓ 11   Changed 4 years ago by thijs

  • status changed from assigned to new
  • owner changed from thijs to loewis

Building it on Python 3.1 fails with this error:

$ python3.1 setup.py build
SyntaxError: invalid token (branchmgr.py, line 571)
  File "setup.py", line 87
    """
      ^
SyntaxError: invalid syntax

Which is fixed with r28147. It then dies with:

Traceback (most recent call last):
  File "setup.py", line 97, in <module>
    main(sys.argv[1:])
  File "setup.py", line 45, in main
    from twisted import copyright
  File "./twisted/__init__.py", line 18, in <module>
    from twisted.python import compat
  File "./twisted/python/compat.py", line 143
    self._lock.release()\n""" % (f, f)
                            ^
SyntaxError: invalid syntax

So there's some more work to be done before this can build cleanly on Python 3.1.

11

in reply to: ↑ 10   Changed 4 years ago by thijs

  • description modified (diff)

Replying to thijs:

So there's some more work to be done before this can build cleanly on Python 3.1.

Which has been done in #4244, sorry I didn't notice this before. So this ticket seems to be blocked by #4244, so let's make that land first.

12

  Changed 4 years ago by thijs

(In [28235]) Add NEWS file, refs #4246

13

  Changed 3 years ago by PenguinOfDoom

  • status changed from new to closed
  • resolution set to duplicate

#4162 removed _c_urlarg completely

Note: See TracTickets for help on using tickets.