You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Under python 3.5.2, I get the following when trying to generate an encryption key:
$ ./manage.py generate_encryption_key
Traceback (most recent call last):
File "./manage.py", line 23, in
execute_from_command_line(sys.argv)
File "/home/ssharkey/.pyenv/versions/conestoga/lib/python3.5/site-packages/django/core/management/init.py", line 367, in execute_from_command_line
utility.execute()
File "/home/ssharkey/.pyenv/versions/conestoga/lib/python3.5/site-packages/django/core/management/init.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ssharkey/.pyenv/versions/conestoga/lib/python3.5/site-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/ssharkey/.pyenv/versions/conestoga/lib/python3.5/site-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/home/ssharkey/.pyenv/versions/conestoga/lib/python3.5/site-packages/cryptographic_fields/management/commands/generate_encryption_key.py", line 12, in handle
self.stdout.write(key)
File "/home/ssharkey/.pyenv/versions/conestoga/lib/python3.5/site-packages/django/core/management/base.py", line 107, in write
if ending and not msg.endswith(ending):
TypeError: endswith first arg must be bytes or a tuple of bytes, not str
The default ending in self.write() from django's management base.py is ending='\n'
IF I change line 11 of generate_encryption_key.py to:
self.stdout.write(key, ending=b'\n')
then it works.
The text was updated successfully, but these errors were encountered:
Under python 3.5.2, I get the following when trying to generate an encryption key:
$ ./manage.py generate_encryption_key
Traceback (most recent call last):
File "./manage.py", line 23, in
execute_from_command_line(sys.argv)
File "/home/ssharkey/.pyenv/versions/conestoga/lib/python3.5/site-packages/django/core/management/init.py", line 367, in execute_from_command_line
utility.execute()
File "/home/ssharkey/.pyenv/versions/conestoga/lib/python3.5/site-packages/django/core/management/init.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ssharkey/.pyenv/versions/conestoga/lib/python3.5/site-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/ssharkey/.pyenv/versions/conestoga/lib/python3.5/site-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/home/ssharkey/.pyenv/versions/conestoga/lib/python3.5/site-packages/cryptographic_fields/management/commands/generate_encryption_key.py", line 12, in handle
self.stdout.write(key)
File "/home/ssharkey/.pyenv/versions/conestoga/lib/python3.5/site-packages/django/core/management/base.py", line 107, in write
if ending and not msg.endswith(ending):
TypeError: endswith first arg must be bytes or a tuple of bytes, not str
The default ending in self.write() from django's management base.py is ending='\n'
IF I change line 11 of generate_encryption_key.py to:
then it works.
The text was updated successfully, but these errors were encountered: