Re: [Django] #31989: Bug in posix implementation of django/core/files/locks.py

2020-09-15 Thread Django
#31989: Bug in posix implementation of django/core/files/locks.py
-+-
 Reporter:  jamercee |Owner:  Hasan
 |  Ramezani
 Type:  Bug  |   Status:  closed
Component:  File |  Version:  3.1
  uploads/storage|
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  locks| Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"7be6a6a4d665061e8bc6a741b16ff92353f5d19e" 7be6a6a4]:
 {{{
 #!CommitTicketReference repository=""
 revision="7be6a6a4d665061e8bc6a741b16ff92353f5d19e"
 Fixed #31989 -- Fixed return value of
 django.core.files.locks.lock()/unlock() on POSIX systems.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.d5e66c5f557bec30fa7b8adf3e0a8646%40djangoproject.com.


Re: [Django] #31989: Bug in posix implementation of django/core/files/locks.py

2020-09-14 Thread Django
#31989: Bug in posix implementation of django/core/files/locks.py
-+-
 Reporter:  jamercee |Owner:  Hasan
 |  Ramezani
 Type:  Bug  |   Status:  assigned
Component:  File |  Version:  3.1
  uploads/storage|
 Severity:  Normal   |   Resolution:
 Keywords:  locks| Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by felixxm):

 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.472c1e28be316a9a94e423d86217a304%40djangoproject.com.


Re: [Django] #31989: Bug in posix implementation of django/core/files/locks.py

2020-09-14 Thread Django
#31989: Bug in posix implementation of django/core/files/locks.py
-+-
 Reporter:  jamercee |Owner:  Hasan
 |  Ramezani
 Type:  Bug  |   Status:  assigned
Component:  File |  Version:  3.1
  uploads/storage|
 Severity:  Normal   |   Resolution:
 Keywords:  locks| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Hasan Ramezani):

 * needs_better_patch:  1 => 0
 * needs_docs:  1 => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.932f2acdd69dc29dcde5b60d0de6eec0%40djangoproject.com.


Re: [Django] #31989: Bug in posix implementation of django/core/files/locks.py

2020-09-13 Thread Django
#31989: Bug in posix implementation of django/core/files/locks.py
-+-
 Reporter:  jamercee |Owner:  Hasan
 |  Ramezani
 Type:  Bug  |   Status:  assigned
Component:  File |  Version:  3.1
  uploads/storage|
 Severity:  Normal   |   Resolution:
 Keywords:  locks| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  1|UI/UX:  0
-+-
Changes (by felixxm):

 * needs_better_patch:  0 => 1
 * needs_docs:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.ae58fdc46d240c2678bba026b355ffa1%40djangoproject.com.


Re: [Django] #31989: Bug in posix implementation of django/core/files/locks.py

2020-09-11 Thread Django
#31989: Bug in posix implementation of django/core/files/locks.py
-+-
 Reporter:  jamercee |Owner:  Hasan
 |  Ramezani
 Type:  Bug  |   Status:  assigned
Component:  File |  Version:  3.1
  uploads/storage|
 Severity:  Normal   |   Resolution:
 Keywords:  locks| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Hasan Ramezani):

 * owner:  nobody => Hasan Ramezani
 * status:  new => assigned
 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/13410 PR]

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.e795b6fa5facb4e86b2b67572b8abfd5%40djangoproject.com.


Re: [Django] #31989: Bug in posix implementation of django/core/files/locks.py

2020-09-09 Thread Django
#31989: Bug in posix implementation of django/core/files/locks.py
--+
 Reporter:  jamercee  |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  File uploads/storage  |  Version:  3.1
 Severity:  Normal|   Resolution:
 Keywords:  locks | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  1 |UI/UX:  0
--+
Changes (by felixxm):

 * has_patch:  1 => 0
 * component:  Core (Other) => File uploads/storage
 * stage:  Unreviewed => Accepted


Comment:

 Thanks for the ticket. Would you like to prepare a pull request? (tests
 are also required).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.988dbd07c2b81840c6637b8eeb093b94%40djangoproject.com.


[Django] #31989: Bug in posix implementation of django/core/files/locks.py

2020-09-09 Thread Django
#31989: Bug in posix implementation of django/core/files/locks.py
+
   Reporter:  jamercee  |  Owner:  nobody
   Type:  Bug   | Status:  new
  Component:  Core (Other)  |Version:  3.1
   Severity:  Normal|   Keywords:  locks
   Triage Stage:  Unreviewed|  Has patch:  1
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  1
  UI/UX:  0 |
+
 The posix version of locks (the version which supports `import fcntl`) has
 a bug. The code attempts to return** True** to indicate success or failure
 acquiring a lock, but instead it always returns **False**. The reason is
 that cpython `fcntl` module returns **None**  if successful, and raises an
 `OSError` to indicate failure (see
 [https://docs.python.org/3/library/fcntl.html#fcntl.flock]).

 Anyone interested in using the non-blocking (i.e. `locks.LOCKS_NB`)
 requires a valid return value to know if they have successfully acquired
 the lock.

 I believe the correct implementation should be the following:


 {{{
 diff --git a/django/core/files/locks.py b/django/core/files/locks.py
 index c46b00b905..4938347ea7 100644
 --- a/django/core/files/locks.py
 +++ b/django/core/files/locks.py
 @@ -107,9 +107,15 @@ else:
  return True
  else:
  def lock(f, flags):
 -ret = fcntl.flock(_fd(f), flags)
 -return ret == 0
 +try:
 +fcntl.flock(_fd(f), flags)
 +return True
 +except OSError:
 +return False

  def unlock(f):
 -ret = fcntl.flock(_fd(f), fcntl.LOCK_UN)
 -return ret == 0
 +try:
 +fcntl.flock(_fd(f), fcntl.LOCK_UN)
 +return True
 +except OSError:
 +return False

 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.13e2ba1c23a0a9343a54662ef7c336ab%40djangoproject.com.