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

Incompatible with Python 2.6 due to use of flags argument to re.sub #48

Closed
rjollos opened this issue Jul 19, 2017 · 5 comments
Closed

Comments

@rjollos
Copy link

rjollos commented Jul 19, 2017

The commit cf7faf77 uses the flags argument to re.sub, which is only available since Python 2.7.

This result in a test failure with Python 2.6 for the Trac project:

Traceback (most recent call last):
  File "C:\projects\trac\trac\mimeview\tests\txtl.py", line 84, in test_html
    """)
  File "C:\projects\trac\trac\mimeview\tests\txtl.py", line 35, in _render
    result = self.renderer.render(self.context, 'textile', text)
  File "C:\projects\trac\trac\mimeview\txtl.py", line 73, in render
    output = render_textile(content)
  File "C:\projects\trac\trac\mimeview\txtl.py", line 46, in render_textile
    return textile.textile(text)
  File "C:\Python26\lib\site-packages\textile\core.py", line 1417, in textile
    return Textile(html_type=html_type).parse(text)
  File "C:\Python26\lib\site-packages\textile\core.py", line 237, in parse
    text = normalize_newlines(text)
  File "C:\Python26\lib\site-packages\textile\utils.py", line 114, in normalize_newlines
    out = re.sub(r'^[ \t]*\n', '\n', out, flags=re.M)
TypeError: sub() got an unexpected keyword argument 'flags'
@rjollos
Copy link
Author

rjollos commented Jul 19, 2017

I noticed the deprecation warning about Textile with Python 2.6, but don't see that support has actually been dropped:

C:\Python26-x64\lib\site-packages\textile\__init__.py:19: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of textile will drop support for Python 2.6
  DeprecationWarning

If you decide to drop support for Python 2.6 we'll just pin older Trac versions on Textile 2.3.12. Newer versions of Trac supports Python 2.7+, however we still have maintenance lines that support Python 2.5 and 2.6.

@ikirudennis
Copy link
Member

This is a little bit surprising given that we have travis set to test against py26. There might be a way around this, though. I'll see what I can do.

@ikirudennis
Copy link
Member

Hi, @rjollos. Would you be able to try testing against the develop branch? pip install -e git+https://github.com/textile/python-textile.git@develop#egg=textile

@rjollos
Copy link
Author

rjollos commented Jul 19, 2017

Sure, I'll run the tests and report back.

@rjollos
Copy link
Author

rjollos commented Jul 19, 2017

Tests are passing on TravisCI and AppVeyor. Thanks!

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

No branches or pull requests

2 participants