Edgewall Software
Modify

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#12856 closed defect (duplicate)

trac-admin fails on Python 3

Reported by: cyril.schmidt@… Owned by:
Priority: normal Milestone:
Component: general Version: 1.2.2
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Jun Omae)

Trac version 1.2.2 for Windows, installed by the binary installer, fails in trac-admin with the error error message shown below.

The python version is Python 3.5.2 :: Anaconda 4.2.0 (64-bit)

I believe the cause is that the 0666 notation for octals is not valid anymore in Python 3, it should have been 0o666.

Error message:

>trac-admin --version
Traceback (most recent call last):
  File "D:\Anaconda3\Scripts\trac-admin-script.py", line 11, in <module>
    load_entry_point('Trac==1.2.2', 'console_scripts', 'trac-admin')()
  File "D:\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\pkg_resources
\__init__.py", line 565, in load_entry_point
  File "D:\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\pkg_resources
\__init__.py", line 2598, in load_entry_point
  File "D:\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\pkg_resources
\__init__.py", line 2258, in load
  File "D:\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\pkg_resources
\__init__.py", line 2264, in resolve
  File "D:\Anaconda3\lib\site-packages\trac\admin\__init__.py", line 14, in <mod
ule>
    from trac.admin.api import *
  File "D:\Anaconda3\lib\site-packages\trac\admin\api.py", line 20, in <module>
    from trac.util.text import levenshtein_distance
  File "D:\Anaconda3\lib\site-packages\trac\util\__init__.py", line 258
    return path, os.fdopen(os.open(path, flags, 0666), 'w')
                                                   ^
SyntaxError: invalid token

Attachments (0)

Change History (3)

comment:1 by Jun Omae, 7 years ago

Description: modified (diff)
Keywords: trac-admin python3 removed
Resolution: duplicate
Status: newclosed

Duplicate of #10083 and #12130.

Last edited 7 years ago by Jun Omae (previous) (diff)

comment:2 by rr.kampen@…, 6 years ago

Am I to understand Trac will not work with Python 3.7?

C:\Windows\system32>trac-admin C:\ initenv
Traceback (most recent call last):
  File "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python37\Scripts\trac-admin-script.py", line 11, in <module>
    load_entry_point('Trac==1.2.3', 'console_scripts', 'trac-admin')()
  File "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python37\lib\site-packages\pkg_resources\__init__.py", line 487, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python37\lib\site-packages\pkg_resources\__init__.py", line 2728, in load_entry_point
    return ep.load()
  File "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python37\lib\site-packages\pkg_resources\__init__.py", line 2346, in load
    return self.resolve()
  File "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python37\lib\site-packages\pkg_resources\__init__.py", line 2352, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python37\lib\site-packages\trac\admin\__init__.py", line 14, in <module>
    from trac.admin.api import *
  File "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python37\lib\site-packages\trac\admin\api.py", line 20, in <module>
    from trac.util.text import levenshtein_distance
  File "C:\Users\Gebruiker\AppData\Local\Programs\Python\Python37\lib\site-packages\trac\util\__init__.py", line 258
    return path, os.fdopen(os.open(path, flags, 0666), 'w')
                                                   ^
SyntaxError: invalid token
Last edited 6 years ago by Jun Omae (previous) (diff)

in reply to:  2 comment:3 by Jun Omae, 6 years ago

Am I to understand Trac will not work with Python 3.7?

You can check Mandatory Dependencies in TracInstall page for Trac 1.2. It describes Python, version ≥ 2.6 and < 3.0.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.