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

Backslashes and : function #173

Closed
1kq2lo40lozpmb63 opened this issue Jan 15, 2016 · 7 comments
Closed

Backslashes and : function #173

1kq2lo40lozpmb63 opened this issue Jan 15, 2016 · 7 comments

Comments

@1kq2lo40lozpmb63
Copy link

The backslash doesn't seem to cope well with string replacements using the : function. The bug is shown here: https://pyth.herokuapp.com/?code=%22%5C%5Chi%22%0A%3A+%22%5C%5Chi%22+%22h%22+%22i%22%0A%3A+%22%5C%5Chi%22+%22%5C%5C%22+%22i%22&debug=0

The full error message is:

Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.4/sre_parse.py", line 194, in __next
IndexError: string index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "pyth.py", line 683, in <module>
  File "<string>", line 6, in <module>
  File "/app/macros.py", line 424, in at_slice
  File "/app/.heroku/python/lib/python3.4/re.py", line 175, in sub
  File "/app/.heroku/python/lib/python3.4/re.py", line 288, in _compile
  File "/app/.heroku/python/lib/python3.4/sre_compile.py", line 465, in compile
  File "/app/.heroku/python/lib/python3.4/sre_parse.py", line 739, in parse
  File "/app/.heroku/python/lib/python3.4/sre_parse.py", line 182, in __init__
  File "/app/.heroku/python/lib/python3.4/sre_parse.py", line 196, in __next
sre_constants.error: bogus escape (end of line)
@refi64
Copy link
Contributor

refi64 commented Jan 15, 2016

Try \\\\.

@niwhsa9
Copy link

niwhsa9 commented Jan 15, 2016

Hey sorry to ask this Isacc, I think pyth is super cool and I really like
it which is why I'm following it. But I don't really want to get all the
emails with the bugs and stuff since its showing up and giving
notifications all the time. Is there some way I can turn off the
notifications without unfollowing the project?

On Thursday, January 14, 2016, Ryan Gonzalez notifications@github.com
wrote:

Try \.


Reply to this email directly or view it on GitHub
#173 (comment).

Ashwin

@isaacg1
Copy link
Owner

isaacg1 commented Jan 15, 2016

Sorry, I don't know github well enough.

@1kq2lo40lozpmb63
Copy link
Author

@kirbyfan64 Thanks for the workaround, but the bug still stands.

@niwhsa9
Copy link

niwhsa9 commented Jan 16, 2016

That's okay thanks. I'll figure it out I'm sure there is a way.

On Friday, January 15, 2016, Raumaan Kidwai notifications@github.com
wrote:

@kirbyfan64 https://github.com/kirbyfan64 Thanks for the workaround,
but the bug still stands.


Reply to this email directly or view it on GitHub
#173 (comment).

Ashwin

@isaacg1 isaacg1 closed this as completed Jan 22, 2016
@isaacg1
Copy link
Owner

isaacg1 commented Jan 22, 2016

This is not a bug - this is just how Python's regex package works. You need to have two layers of escaping - one for Pyth, one for regex.

@vendethiel
Copy link
Contributor

Btw, you can change it in your github settings (you'll have to login once more). Just go to notifications, and uncheck the email boxes (IIRC).

PS: started learning Pyth today, loving it already :D. Not quite as powerful as J or APL, but great for its golfing niche.

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

5 participants