Not compatible with python 3

Bug #1040093 reported by Paul Tremblay on 2012-08-22
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
oursql
Undecided
Unassigned

Bug Description

python3 setup.py build

  File "setup.py", line 53
    print "cython not found, using previously-cython'd .c file."
                                                               ^
SyntaxError: invalid syntax

2to3 -w .

python3 setup.py build

Traceback (most recent call last):
  File "setup.py", line 234, in <module>
    cmdclass=oursql_commands,
  File "/usr/local/lib/python3.2/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/lib/python3.2/distutils/dist.py", line 917, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python3.2/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.2/distutils/command/build.py", line 126, in run
    self.run_command(cmd_name)
  File "/usr/local/lib/python3.2/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python3.2/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.2/distutils/command/build_ext.py", line 345, in run
    self.build_extensions()
  File "/usr/local/lib/python3.2/distutils/command/build_ext.py", line 454, in build_extensions
    self.build_extension(ext)
  File "setup.py", line 150, in build_extension
    build_ext.build_extension(self, ext)
  File "/usr/local/lib/python3.2/distutils/command/build_ext.py", line 497, in build_extension
    extra_args = ext.extra_compile_args or []
  File "setup.py", line 29, in _get_extra_compile_args
    self._mysql_compile_args = self.get_mysql_compile_args()
  File "setup.py", line 100, in <lambda>
    lambda: self.get_mysql_config('cflags'))
  File "setup.py", line 96, in get_mysql_config
    return split_quoted(stdout.strip())
  File "/usr/local/lib/python3.2/distutils/util.py", line 337, in split_quoted
    m = _wordchars_re.match(s, pos)
TypeError: can't use a string pattern on a bytes-like object

Don't use 2to3, use the branch with the python3 code.

This is a cython project, not compatible with the transition tools.

On Wed, Aug 22, 2012 at 3:38 PM, Paul Tremblay <email address hidden> wrote:
> Public bug reported:
>
> python3 setup.py build
>
> File "setup.py", line 53
> print "cython not found, using previously-cython'd .c file."
> ^
> SyntaxError: invalid syntax
>
> 2to3 -w .
>
> python3 setup.py build
>
> Traceback (most recent call last):
> File "setup.py", line 234, in <module>
> cmdclass=oursql_commands,
> File "/usr/local/lib/python3.2/distutils/core.py", line 148, in setup
> dist.run_commands()
> File "/usr/local/lib/python3.2/distutils/dist.py", line 917, in run_commands
> self.run_command(cmd)
> File "/usr/local/lib/python3.2/distutils/dist.py", line 936, in run_command
> cmd_obj.run()
> File "/usr/local/lib/python3.2/distutils/command/build.py", line 126, in run
> self.run_command(cmd_name)
> File "/usr/local/lib/python3.2/distutils/cmd.py", line 313, in run_command
> self.distribution.run_command(command)
> File "/usr/local/lib/python3.2/distutils/dist.py", line 936, in run_command
> cmd_obj.run()
> File "/usr/local/lib/python3.2/distutils/command/build_ext.py", line 345, in run
> self.build_extensions()
> File "/usr/local/lib/python3.2/distutils/command/build_ext.py", line 454, in build_extensions
> self.build_extension(ext)
> File "setup.py", line 150, in build_extension
> build_ext.build_extension(self, ext)
> File "/usr/local/lib/python3.2/distutils/command/build_ext.py", line 497, in build_extension
> extra_args = ext.extra_compile_args or []
> File "setup.py", line 29, in _get_extra_compile_args
> self._mysql_compile_args = self.get_mysql_compile_args()
> File "setup.py", line 100, in <lambda>
> lambda: self.get_mysql_config('cflags'))
> File "setup.py", line 96, in get_mysql_config
> return split_quoted(stdout.strip())
> File "/usr/local/lib/python3.2/distutils/util.py", line 337, in split_quoted
> m = _wordchars_re.match(s, pos)
> TypeError: can't use a string pattern on a bytes-like object
>
> ** Affects: oursql
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to oursql.
> https://bugs.launchpad.net/bugs/1040093
>
> Title:
> Not compatible with python 3
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/oursql/+bug/1040093/+subscriptions

Paul Tremblay (paulhtremblay) wrote :

Thanks. I just got around to trying to set this up on my Windows machine after using it successfully with Ubuntu. The binary installer fails because I have Python 3.2 installed.

When I try to build from source, I get this error:

cython not found, using previously-cython'd .c file.
running build
running build_ext

error: The system cannot find the file specified

thezeus18 (thezeus18) wrote :

same error as tremblay even with new release

Greg MacDonald (gtmacdonald) wrote :

This is a bug with the setup.py script. The first time through with the build_ext command it works with the extra parameters.

The second time through it can't find the the mysql_root option. It attempt to find it through the registry but can't. I tried helping it along by manually setting the correct registry key in setup.py but I think it failed because I'm in 64 bit windows with the additional WoW64 registry.

Setting mysql_root parameter manually in setup.py worked:

self.mysql_root = r'C:\Program Files\MySQL\MySQL Server 5.6'

FYI this will make distutils output more useful debug information:

set DISTUTILS_DEBUG=1

So frustrating. Also be sure and have visual studio 2010 installed, that's what python 3.3 uses.

Jacob Magnusson (q-d-k) wrote :

I'm having this problem with Python 3.4 as well. I would fix it for you if Bazaar wasn't so frustrating to use...

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers