Opened 5 years ago

Closed 3 years ago

#4246 enhancement closed duplicate (duplicate)

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)

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 (2)

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

Download all attachments as: .zip

Change History (15)

Changed 5 years ago by loewis

comment:1 Changed 5 years ago by loewis

  • Keywords py3k added

comment:2 Changed 5 years ago by spiv

  • Cc spiv added
  • Keywords review added

comment:3 Changed 5 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.

comment:4 Changed 5 years ago by loewis

  • Owner glyph deleted

Changed 5 years ago by loewis

comment:5 Changed 5 years ago by thijs

  • Cc thijs added
  • Keywords review removed
  • Milestone set to Python-3.x
  • Owner set to thijs
  • Status changed from new to assigned

comment:6 Changed 5 years ago by thijs

  • Author set to thijs
  • Branch set to branches/c-urlarg-4246

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

comment:7 Changed 5 years ago by thijs

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

comment:8 Changed 5 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

comment:9 Changed 5 years ago by thijs

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

comment:10 follow-up: Changed 5 years ago by thijs

  • Owner changed from thijs to loewis
  • Status changed from assigned to new

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.

comment:11 in reply to: ↑ 10 Changed 5 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.

comment:12 Changed 5 years ago by thijs

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

comment:13 Changed 3 years ago by PenguinOfDoom

  • Resolution set to duplicate
  • Status changed from new to closed

#4162 removed _c_urlarg completely

Note: See TracTickets for help on using tickets.