[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2016-03-20 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

--
nosy: +berker.peksag
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.6 -Python 2.7, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2016-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f736aea929c2 by Berker Peksag in branch '3.5':
Issue #19164: Improve exception message of uuid.UUID()
https://hg.python.org/cpython/rev/f736aea929c2

New changeset e59b799df6e2 by Berker Peksag in branch 'default':
Issue #19164: Improve exception message of uuid.UUID()
https://hg.python.org/cpython/rev/e59b799df6e2

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2016-03-20 Thread Elena Oat

Elena Oat added the comment:

I tested the patch and it seems fine. Also ran tests for uuid.py and it they 
passed.

--
nosy: +Elena.Oat

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2014-12-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
keywords: +needs review
stage: needs patch - patch review
versions: +Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19164
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2013-11-17 Thread Jon Gauthier

Changes by Jon Gauthier j...@gauthiers.net:


--
keywords: +patch
Added file: http://bugs.python.org/file32678/issue19164.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19164
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2013-10-04 Thread Marco Buccini

New submission from Marco Buccini:

When you try to use uuid.UUID() without arguments you get a TypeError exception 
saying that you can actually use an integer (while you cannot). 

Python 2.6.8 (default, Apr 26 2013, 16:24:53) 
[GCC 4.6.3] on linux2
 uuid.UUID()
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python2.6/uuid.py, line 129, in __init__
raise TypeError('need one of hex, bytes, bytes_le, fields, or int')
TypeError: need one of hex, bytes, bytes_le, fields, or int

 uuid.UUID(uuid.uuid4().int)
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python2.6/uuid.py, line 131, in __init__
hex = hex.replace('urn:', '').replace('uuid:', '')
AttributeError: 'long' object has no attribute 'replace'

So, let's check with an integer - maybe an int has 'replace'.
 uuid.UUID(1231231)
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python2.6/uuid.py, line 131, in __init__
hex = hex.replace('urn:', '').replace('uuid:', '')
AttributeError: 'int' object has no attribute 'replace'

No, it doesn't. Anyway, with a propery hex value, it works (of course!).

 uuid.UUID(uuid.uuid4().hex)
UUID('89b1283d-c32e-4b8a-a9e3-a699445fdd4d')

--
assignee: docs@python
components: Documentation
messages: 198943
nosy: docs@python, makronized
priority: normal
severity: normal
status: open
title: Update uuid.UUID TypeError exception: integer should not be an argument.
type: behavior
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19164
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2013-10-04 Thread Vajrasky Kok

Vajrasky Kok added the comment:

The exception message is correct. You can give an integer argument. But you 
have to use keyword argument.

 uuid.UUID(int=uuid.uuid4().int)
UUID('62ad61e5-b492-4f01-81e6-790049051c4f')

From the documentation:

 __init__(self, hex=None, bytes=None, bytes_le=None, fields=None, int=None, v
ersion=None)
 |  Create a UUID from either a string of 32 hexadecimal digits,
 |  a string of 16 bytes as the 'bytes' argument, a string of 16 bytes
 |  in little-endian order as the 'bytes_le' argument, a tuple of six
 |  integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version,
 |  8-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as
 |  the 'fields' argument, or a single 128-bit integer as the 'int'
 |  argument.  When a string of hex digits is given, curly braces,
 |  hyphens, and a URN prefix are all optional.  For example, these
 |  expressions all yield the same UUID:

--
nosy: +vajrasky

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19164
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2013-10-04 Thread Georg Brandl

Georg Brandl added the comment:

Yeah, the first message should probably say one of the hex, bytes, bytes_le, 
fields, or int arguments must be given

--
nosy: +georg.brandl

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19164
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2013-10-04 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
keywords: +easy
nosy: +ezio.melotti
stage:  - needs patch
versions: +Python 2.7 -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19164
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com