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

emit_notices management command and send_all have several errors #76

Open
ashishbb opened this issue Oct 31, 2017 · 0 comments
Open

emit_notices management command and send_all have several errors #76

ashishbb opened this issue Oct 31, 2017 · 0 comments

Comments

@ashishbb
Copy link

I've just recently started experimenting with emit_notices in pinax-notifications and I have been facing several issues. I am unsure if I am running something incorrectly.

When I run emit_notices management command, I immediately receive the error :

  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "C:\Python27\lib\site-packages\pinax\notifications\management\commands\emit_notices.py", line 14, in handle
    send_all(*args)
  File "C:\Python27\lib\site-packages\pinax\notifications\engine.py", line 41, in send_all
    lock = acquire_lock(*args)
  File "C:\Python27\lib\site-packages\pinax\notifications\engine.py", line 29, in acquire_lock
    lock.acquire(settings.PINAX_NOTIFICATIONS_LOCK_WAIT_TIMEOUT)
  File "C:\Python27\lib\site-packages\pinax\notifications\lockfile.py", line 354, in acquire
    self.attempt_acquire(self, timeout, end_time, wait)
TypeError: attempt_acquire() takes exactly 4 arguments (5 given)

This error is seems to be due to "self" being passed in to another class method when I believe "self" is passed in to all methods by default by the class so "self" gets passed twice.

If I remove "self" from being passed into "attempt_acquire" in lockfile.py, line 354, the lockfile gets stuck in the while loop in lockfile.py, line 353 and loops infinitely even after a lockfile is created.

while True:
    self.attempt_acquire(timeout, end_time, wait)

Note : I am using PINAX_NOTIFICATIONS_LOCK_WAIT_TIMEOUT = -1 (default). I have also tried setting it to 1, but the lock is never acquired either way.

And finally, I faced this issue as well.

Am I doing something wrong here? I am currently using Windows 10 with Python 2.7 but I have also tried with Linux machines and got the same results (I have not tried Python 3.x). Pinax packages have always been very solid for me so I am surprised about all the problems I am facing with emit_notices.

Any help is appreciated! Thank you.

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

No branches or pull requests

2 participants