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 3 #18

Closed
Ichimonji10 opened this issue May 13, 2014 · 8 comments
Closed

incompatible with Python 3 #18

Ichimonji10 opened this issue May 13, 2014 · 8 comments

Comments

@Ichimonji10
Copy link
Contributor

Fauxfactory appears to be incompatible with Python 3.

Why do I say this? When executing one of the example lines of code displayed in the readme (FauxFactory.generate_alphanumeric()), I get an error stating name 'unicode' is not defined. This is probably because the application assumes that it is being run under Python 2. However, unicode support has been more fully integrated in Python 3, and the "unicode" function has been removed from the standard library.

Here's some copy-pasta from my machine:

Python 3.4.0 (default, Mar 17 2014, 23:20:09)·                                                                        
[GCC 4.8.2 20140206 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from fauxfactory import FauxFactory
>>> FauxFactory.generate_alphanumeric()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.4/site-packages/fauxfactory/__init__.py", line 102, in generate_alphanumeric
    return unicode(output_string)
NameError: name 'unicode' is not defined
@Ichimonji10
Copy link
Contributor Author

Yeppers peppers. The exact same set of commands works under Python 2.

Python 2.7.6 (default, Feb 26 2014, 12:07:17)·
[GCC 4.8.2 20140206 (prerelease)] on linux2                                                                           
Type "help", "copyright", "credits" or "license" for more information.
>>> from fauxfactory import FauxFactory
>>> FauxFactory.generate_alphanumeric()
u'MVK6H'

@omaciel
Copy link
Owner

omaciel commented May 13, 2014

Thanks for the issue @Ichimonji10 I'll work on getting it compatible with Python 3.

@Ichimonji10
Copy link
Contributor Author

👍

@Ichimonji10
Copy link
Contributor Author

Travis uses Python 2.7 by default.

http://docs.travis-ci.com/user/languages/python/#Default-Python-Version

@omaciel
Copy link
Owner

omaciel commented May 15, 2014

Done! I may do some refactoring but it should be good to go now:

@omaciel omaciel closed this as completed May 15, 2014
@Ichimonji10
Copy link
Contributor Author

Great! I can confirm that the test suite runs successfully under Python 2.7.6 and 3.4.0, at least on my dev machine.

@omaciel
Copy link
Owner

omaciel commented May 16, 2014

Cool! I also tested it on 3.4 here and it worked. I wonder if Travis has 3.4 already...

@Ichimonji10
Copy link
Contributor Author

Yes, it does.

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