#26237: uuid.UUID() generates 'invalid syntax' and 'badly formed' uuids
-------------------------------+--------------------
     Reporter:  MalikRumi      |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  Uncategorized  |    Version:  1.9
     Severity:  Normal         |   Keywords:  uuid
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 Background: I've been struggling for about a week trying to use fixtures
 to load initial data into a website. See
 http://stackoverflow.com/questions/35463713/badly-formed-hexadecimal-uuid-
 string-error-in-django-fixture-json-uuid-conversi and
 https://groups.google.com/forum/#!topic/django-users/Q4zybgExDyY.

 Once I did the test suggested to me on SO, it became clear that this was
 not a json issue. That test was as follows:

         In [5]: e.uuid
         Out[5]: UUID('61877565-5fe5-4175-9f2b-d24704df0b74')
         In [6]: uuid.UUID(61877565-5fe5-4175-9f2b-d24704df0b74)
         File "<ipython-input-6-56137f5f4eb6>", line 1
         uuid.UUID(61877565-5fe5-4175-9f2b-d24704df0b74)
                                                      ^
         SyntaxError: invalid syntax  # It doesn't show here for some
 reason, but the caret is pointing to the 4th '5' in the 12th position,
 from left to right.

 It did not matter if I copy pasted the uuid or retyped the whole thing by
 hand, I got the same error. If I quoted the uuid, I got a different error:

     In [7]: uuid.UUID('61877565-5fe5-4175-9f2b-d24704df0b74')
 ---------------------------------------------------------------------------
     NameError                                 Traceback (most recent call
 last)
     <ipython-input-7-3b4d3e5bd156> in <module>()
     ----> 1 uuid.UUID('61877565-5fe5-4175-9f2b-d24704df0b74')

     NameError: name 'uuid' is not defined

 I am using Ubuntu 15.10, Django 1.9.1, Postgresql 9.4 and Python 2.7.10. I
 don't know if this a Python issue rather than a Django issue, but it
 can't, or shouldn't, be that Django/Python can't accept, recognize, or
 evaluate a uuid it generated seconds earlier.

--
Ticket URL: <https://code.djangoproject.com/ticket/26237>
Django <https://code.djangoproject.com/>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.52b287cceb028bb55fa161cda79d290e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to