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

Error in file locking backend with python 3 #74

Closed
Maberi opened this issue Dec 15, 2015 · 2 comments
Closed

Error in file locking backend with python 3 #74

Maberi opened this issue Dec 15, 2015 · 2 comments
Labels

Comments

@Maberi
Copy link

Maberi commented Dec 15, 2015

File ".../lib/python3.4/site-packages/django_cron/backends/lock/file.py", line 20, in lock
f = open(lock_name, 'w+', 0)
ValueError: can't have unbuffered text I/O

For python3, should change line 20 to f = open(lock_name, 'wb+', 0) and line 37 to f.write(bytearray(str(os.getpid()), 'utf-8'))

@lindlof
Copy link

lindlof commented Apr 1, 2016

I did the same except I changed the line 37 to:
f.write(bytes(str(os.getpid()), 'UTF-8'))

Tested and works.

@tab-cmd tab-cmd added the Bug label Jan 13, 2017
@maxim-kht
Copy link
Contributor

Resolved in #110

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

No branches or pull requests

4 participants