Vajrasky Kok added the comment:
Here is the preliminary patch. Only tested on Linux. Later I'll test it on
Windows.
--
keywords: +patch
nosy: +vajrasky
Added file:
http://bugs.python.org/file32947/add_non_strict_resolve_pathlib.patch
___
Python
New submission from Vajrasky Kok:
Steps to reproduce the bug:
1. Download cute cat picture from internet. Name it CuteCat.jpg.
import os
os.listdir('.')
['CuteCat.jpg']
2. Create symbolic link.
os.symlink('CuteCat.jpg', 'Aaawww.lnk')
os.listdir('.')
['Aaawww.lnk', 'CuteCat.jpg']
3. Do
Vajrasky Kok added the comment:
Python 2.7 on Windows does not have symlink.
Python 3.3 on Windows got the same symptom as Python 3.4. Do we need to fix it?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19848
Vajrasky Kok added the comment:
This is the patch for Python 3.3.
--
Added file:
http://bugs.python.org/file32925/fix_python_33_windows_create_existed_symlink.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19848
Vajrasky Kok added the comment:
Before patch:
$ ./python -S Lib/test/test_site.py
Traceback (most recent call last):
File Lib/test/test_site.py, line 28, in module
raise unittest.SkipTest(importation of site.py suppressed)
unittest.case.SkipTest: importation of site.py suppressed
After
Vajrasky Kok added the comment:
Updated grammar according to Arfrever's review. Thanks!
Anyway, should samefile accepts only string? Or should it accept Path object as
well?
--
Added file: http://bugs.python.org/file32927/pathlib_samefile_v2.patch
New submission from Vajrasky Kok:
In class Path, line 942, you have this comment:
# Public API
but down there, in line 1048, you have this private method:
def _raw_open(self, flags, mode=0o777):
Open the file pointed by this path and return a file descriptor
Changes by Vajrasky Kok sky@speaklikeaking.com:
--
title: bad error message in os.rename - Bad error message in os.rename,
os.link, and os.symlink
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16074
Vajrasky Kok added the comment:
Here is the patch for Python 3.4. It removed file information for os.rename,
os.link, and os.symlink.
I agree with Ezio that giving extra information is better but since Python 3.4
is in beta maybe we can defer this to Python 3.5.
There are couples
Vajrasky Kok added the comment:
Patch for Python 3.3. It omitted file information for error messages in rename,
symlink, and link.
I'll create a separate ticket for adding extra file information to these error
messages.
--
Added file:
http://bugs.python.org/file32935
Vajrasky Kok added the comment:
Here is the patch.
--
keywords: +patch
nosy: +vajrasky
Added file: http://bugs.python.org/file32916/pathlib_samefile.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19775
New submission from Vajrasky Kok:
$ ./python -S Lib/test/test_site.py
Traceback (most recent call last):
File Lib/test/test_site.py, line 28, in module
raise unittest.SkipTest(importation of site.py suppressed)
unittest.case.SkipTest: importation of site.py suppressed
This counts as fail
New submission from Vajrasky Kok:
$ ./python Lib/test/test_poplib.py
omitted
test_uidl (__main__.TestPOP3_TLSClass) ... ok
test_user (__main__.TestPOP3_TLSClass) ... ok
--
Ran 62 tests in 4.994s
OK
/home/ethan/Documents
Vajrasky Kok added the comment:
I come out with two patches.
The first patch using bytes generator to copy the message before mutating it in
string generator, then restore it after printing the mutated message.
--
keywords: +patch
Added file:
http://bugs.python.org/file32865
Vajrasky Kok added the comment:
The second patch copies the private variables of the message before mutating it
in string generator, then restore the private variables after printing the
mutated message.
--
Added file:
http://bugs.python.org/file32866
Vajrasky Kok added the comment:
I got another inspiration.
The third patch uses copy.copy to copy the Message before mutating it in string
generator, then restore it after printing the mutated message.
--
Added file:
http://bugs.python.org/file32867
Vajrasky Kok added the comment:
Here is the patch (by Christian Heimes) with unit test (by me).
Apparently the namespace handlers (start-ns and end-ns) got problem with empty
namespace. But they (start-ns and end-ns) must be combined together to create
this problem. start-ns handler only
Vajrasky Kok added the comment:
I agree. The test is not that meaningful. But hey, we have the test that tests
this kind of constant.
http://hg.python.org/cpython/rev/513da56d28de
--
nosy: +vajrasky
___
Python tracker rep...@bugs.python.org
http
Vajrasky Kok added the comment:
I agree we should not go extra mile to add feature for Windows XP, a 12 year
old software and soon to be put down a couple months forward.
But in this case, Antoine goes extra mile to prevent symbolic link support in
Windows XP. And it's not just him that has
Vajrasky Kok added the comment:
How about we defer this to Python 3.5, to make merging easier ?
Sure.
--
versions: +Python 3.5 -Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19791
New submission from Vajrasky Kok:
from collections import deque
deque('abc', maxlen='a')
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: an integer is required
But it's a lie. You can give None to maxlen
deque('abc', maxlen=None)
deque(['a', 'b', 'c'])
maxlen
New submission from Vajrasky Kok:
Right now, Lib/test/test_pathlib.py uses custom checking symbolic link
function. But in test.support, we have those functions already (can_symlink and
skip_unless_symlink). The only feature that test.support checking symbolic link
functions don't have
New submission from Vajrasky Kok:
In Lib/pathlib.py, we got this problematic code:
if sys.getwindowsversion()[:2] = (6, 0):
from nt import _getfinalpathname
else:
supports_symlinks = False
_getfinalpathname = None
This code means if the windows version
New submission from Vajrasky Kok:
import _tracemalloc
_tracemalloc._get_object_traceback.__doc__
'get_object_traceback(obj)\n\nGet the traceback where the Python object obj was
allocated.\nReturn a tuple of (filename: str, lineno: int) tuples.\n\nReturn
None if the tracemalloc module
Vajrasky Kok added the comment:
Here is the patch to tidy up the Lib/test_tracemalloc.py.
It fixed the typo, and removed unused import and unused variables.
--
nosy: +vajrasky
Added file: http://bugs.python.org/file32828/minor_makeup_test_tracemalloc.patch
Vajrasky Kok added the comment:
R. David Murray, your patch fails with this situation:
from email.mime.nonmultipart import *
from email.charset import *
from email.message import Message
from io import BytesIO
from email.generator import BytesGenerator
msg = Message()
cs = Charset('utf-8
Vajrasky Kok added the comment:
Simpler patch.
--
Added file: http://bugs.python.org/file32802/support_8bit_charset_cte_v3.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19063
Vajrasky Kok added the comment:
No review link?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19063
___
___
Python-bugs-list mailing list
New submission from Vajrasky Kok:
from collections import defaultdict
defaultdict('')
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: first argument must be callable
defaultdict(None)
defaultdict(None, {})
None()
Traceback (most recent call last):
File stdin
New submission from Vajrasky Kok:
$ ./python Lib/test/test_asyncio/test_base_events.py
./home/ethan/Documents/code/python/cpython3.4/Lib/unittest/case.py:158:
ResourceWarning: unclosed socket.socket fd=10, family=AddressFamily.AF_INET,
type=SocketType.SOCK_STREAM
Vajrasky Kok added the comment:
Here is the preliminary patch.
--
nosy: +vajrasky
Added file:
http://bugs.python.org/file32582/fix_error_message_write_fields_not_in_fieldnames.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Changes by Vajrasky Kok sky@speaklikeaking.com:
--
components: +Library (Lib)
versions: +Python 3.3, Python 3.4 -Python 2.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19449
Vajrasky Kok added the comment:
Typo:
s/immediatly/immediately.
I attached the patch.
--
nosy: +vajrasky
Added file: http://bugs.python.org/file32586/fix_typo_19466.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19466
Vajrasky Kok added the comment:
Ah, I missed that. I made this assumption because when I executed other modules
manually, they were there just for testing functionality (such as shlex and
aifc).
Added test.
--
Added file: http://bugs.python.org/file32559/compileall_force_v2.patch
Vajrasky Kok added the comment:
Tidied up the test.
--
Added file: http://bugs.python.org/file32560/compileall_force_v3.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19532
Vajrasky Kok added the comment:
Attached the patch to fix the problem. I did not modify the unit test because
the bug was located in the __main__ part of Lib/compileall.
--
keywords: +patch
nosy: +vajrasky
Added file: http://bugs.python.org/file32553/compileall_force.patch
Vajrasky Kok added the comment:
Attached the patch to raise error when using sock dgram in wrap_socket.
I am still unsure whether I should put the validation in C code (private
function _wrap_socket) or not.
--
keywords: +patch
nosy: +vajrasky
Added file:
http://bugs.python.org
Vajrasky Kok added the comment:
You forgot to upload the proposed patch, Serhiy.
--
nosy: +vajrasky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19492
Vajrasky Kok added the comment:
Py_ssize_t is signed long. size_it is unsigned long. In this case, I suppose we
should avoid unsigned as much as possible in comparison with signed.
So I think Zachary's patch is reasonable.
What do you think, Victor
Vajrasky Kok added the comment:
Serhiy,
In Python3.4, Windows Vista 32 bit, Release Mode, Tcl/Tk 8.5.15, I got a lot of
errors. However, if I set _conv_pixels to round in
Lib/tkinter/test/widget_tests.py, everything works fine.
In Python 3.4, Fedora 18, Debug Mode, Tcl/Tk 8.5.13, I got a lot
New submission from Vajrasky Kok:
Lib/email/message.py, line 665 666:
param = msg.get_param('foo')
param = email.utils.collapse_rfc2231_value(rawparam)
Where does rawparam come from?
On top of that, sending the result of get_param to collapse_rfc2231_value can
make it chokes
Changes by Vajrasky Kok sky@speaklikeaking.com:
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19485
___
___
Python
New submission from Vajrasky Kok:
Right now, at November 3rd 2013, the latest minor version of Tcl/Tk 8.5 is
8.5.15.
http://www.activestate.com/activetcl/downloads
http://www.tcl.tk/
When building Python in Windows in release mode (not debug mode), I had to
download the Tcl/Tk binary build
Vajrasky Kok added the comment:
Should we add partialmethod to __all__ for consistency?
--
nosy: +vajrasky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4331
Vajrasky Kok added the comment:
Except for the typo noticed by Victor, your patch looks good.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18985
Vajrasky Kok added the comment:
Serhiy, you still left debugging code there.
Lib/unittest/test/test_case.py, line 879 and line 880.
#print()
#print(str(cm.exception))
--
nosy: +vajrasky
___
Python tracker rep...@bugs.python.org
http
Vajrasky Kok added the comment:
Here is another patch to better the error message. Right now, the error message
when wrong input sent to unhexlify is a little bit funny.
import binascii
binascii.unhexlify(3)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError
Vajrasky Kok added the comment:
Zachary, perharps you could make a diff with mercurial so we can have Rietveld
review link. I don't know whether git can do that or not.
--
nosy: +vajrasky
___
Python tracker rep...@bugs.python.org
http
Vajrasky Kok added the comment:
Attached the *preliminary* patch to address R. David Murray's request.
It does not address the case where we send raw utf-8 bytes to payload. Maybe we
should handle that in different ticket.
msg.set_payload(b'\xd0\x90\xd0\x91\xd0\x92') == chucks
Changes by Vajrasky Kok sky@speaklikeaking.com:
--
nosy: +r.david.murray, vajrasky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19470
Vajrasky Kok added the comment:
Attached the patch to fix the doc. I also fix the module doc because I think
bytes and str data types are matter of life and death in this binascii module.
--
keywords: +patch
nosy: +vajrasky
Added file: http://bugs.python.org/file32459
Vajrasky Kok added the comment:
Attached the patch to accommodate Terry J. Reedy's request.
--
Added file:
http://bugs.python.org/file32460/remove_extra_slash_from_sys_path_v2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Vajrasky Kok added the comment:
Antoine, I think you forgot to update the doc.
http://docs.python.org/3.4/library/binascii.html#binascii.unhexlify
Changed in version 3.2: Accept only bytestring or bytearray objects as input.
Attached the patch to update the doc to reflect the changes
Vajrasky Kok added the comment:
So msg.as_string() =
cte - base64
message - 0JDQkdCS # base64 encoded string
What about msg.as_bytes()? Should it be:
cte - 8bit
message - \\u0410\\u0411\\u0412 (raw-unicode-escape) or
\xd0\x90\xd0\x91\xd0\x92 (utf-8)?
or message - 0JDQkdCS (base64
New submission from Vajrasky Kok:
Apparently there is no test for MIMENonMultipart.
[sky@localhost cpython]$ grep -R MIMENonMultipart Lib/test/*
[sky@localhost cpython]$
Attached the patch to add test for MIMENonMultipart.
--
components: Tests
files: add_test_non_multipart.patch
Vajrasky Kok added the comment:
Here is the preliminary patch to fix the problem. My patch produces 8bit for
msg.as_string and msg.as_bytes for simplicity reason.
If msg.as_string should gives content-transfer-encoding 7bit with 8bit data but
msg.as_bytes should gives content-transfer
Vajrasky Kok added the comment:
Okay, so for this case, what are the correct outputs for the cte and the
message?
from email.charset import Charset
from email.message import Message
cs = Charset('utf-8')
cs.body_encoding = None # disable base64
msg
New submission from Vajrasky Kok:
from email.mime.nonmultipart import MIMENonMultipart
MIMENonMultipart.__doc__
'Base class for MIME multipart/* type messages.'
Attached the patch to fix the doc of MIMENonMultipart class.
--
assignee: docs@python
components: Documentation
files
Vajrasky Kok added the comment:
Victor, I found out that this commit
http://hg.python.org/cpython/rev/34e166d60f37 gives me compiler warning.
Objects/unicodeobject.c: In function ‘PyUnicode_CompareWithASCIIString’:
Objects/unicodeobject.c:10583:22: warning: pointer targets in initialization
Vajrasky Kok added the comment:
Apparently my fear is unfounded. The dist, version, id have been initialized
with empty value. So if the os-release file does not have complete information,
it should be okay with the patch from Andrei Duma
Vajrasky Kok added the comment:
Hi, Andrei.
Could you provide the test? You could take a look at issue 17429 to see how it
is done.
http://bugs.python.org/issue17429
We would be grateful if you could test the case where os-release file is
non-ascii encoded file (although technically
Vajrasky Kok added the comment:
I finally found the main culprit which puts extra '/' in my sys.path. The patch
removed the extra '/' and also fixed this test automatically.
--
Added file:
http://bugs.python.org/file32367/remove_extra_slash_from_sys_path.patch
Vajrasky Kok added the comment:
This issue has been accidentally fixed by
http://hg.python.org/cpython/rev/513da56d28de commit.
Time to close it? Any last words?
--
nosy: +brett.cannon
___
Python tracker rep...@bugs.python.org
http
Vajrasky Kok added the comment:
Attached the patch to fix the test.
The main issue is that with S flag, we do not have help in builtins. And I
think that is deliberate.
[sky@localhost cpython]$ ./python -S
Python 3.4.0a4+ (default:64fb6a58ebf4+, Oct 26 2013, 19:04:01)
[GCC 4.7.2 20121109
Vajrasky Kok added the comment:
Attached the patch based on Serhiy's suggestion.
--
Added file: http://bugs.python.org/file32376/fix_test_pydoc_with_S_flag_v2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19397
Vajrasky Kok added the comment:
This is the emergency patch to solve this issue.
The main issue is,
[sky@localhost cpython]$ ./python -Sc import sys; print(sys.path)
['', '/usr/local/lib/python34.zip',
'/home/sky/Code/python/programming_language/cpython/Lib/',
'/home/sky/Code/python
Vajrasky Kok added the comment:
Hi Andrei Duma,
I have looked at your patch but have not tested it yet. But it seems to me that
your patch is a little bit weak against the case where the file /etc/os-release
is found, but not fully functional (either garbage, or only releases NAME
New submission from Vajrasky Kok:
In Lib/venv/__init__.py, line 348:
raise ValueError('This script is only for use with Python 3.3')
But I am running Python 3.4. Attached the patch to make it better.
raise ValueError('This script is only for use with Python = 3.3')
If you feel it does
Vajrasky Kok added the comment:
Do we really need to test these constants in unit test?
Other constants such as RLIMIT_STACK, RLIMIT_DATA, etc are not being tested.
Other consideration includes people built custom kernel without these
constants, or maybe they have outdated glibc
Vajrasky Kok added the comment:
Or if we really want to test these constants, we can use something like this:
if hasattr(resource, 'RLIMIT_NICE'):
self.assertIsInstance(resource.RLIMIT_NICE, int)
Or if we want to be so strict:
if hasattr(resource, 'RLIMIT_NICE'):
self.assertTrue(-20
Vajrasky Kok added the comment:
Added patch to add timezone support for sqlite3 datetime adapter.
--
keywords: +patch
nosy: +vajrasky
Added file:
http://bugs.python.org/file32253/add_timezone_support_for_sqlite3_datetime_adapter.patch
___
Python
Vajrasky Kok added the comment:
What about dbm.gnu and dbm.dumb? Should we add string key support as well?
--
nosy: +vajrasky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19287
Vajrasky Kok added the comment:
Sorry, I just found out that you already created a separate ticket for dbm.gnu.
http://bugs.python.org/issue19288
What about dbm.dumb?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19287
New submission from Vajrasky Kok:
I got this warning when compiling dbm module with Python 3.4.
/home/sky/Code/python/programming_language/cpython/Modules/_dbmmodule.c: In
function ‘newdbmobject’:
/home/sky/Code/python/programming_language/cpython/Modules/_dbmmodule.c:55:5:
warning: passing
Vajrasky Kok added the comment:
Attached the patch to fix the resource warning problem.
--
keywords: +patch
nosy: +vajrasky
Added file:
http://bugs.python.org/file32224/close_httpd_server_in_asyncio_test_utils.patch
___
Python tracker rep
Vajrasky Kok added the comment:
Serhiy's commit http://hg.python.org/cpython/rev/2e8c424dc638 fixed this issue
already. So I closed this ticket.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http
Vajrasky Kok added the comment:
Serhiy, you forgot to add shorten to __all__.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18725
Vajrasky Kok added the comment:
I think giving deprecation message when accessing incorrect attribute from spwd
struct is not practical. You're right, R. David Murray, as you can see in
spwd_struct_members_name_fix_v2.patch.
So I make a simpler patch. I just give a deprecation message
Vajrasky Kok added the comment:
Stopped the leaking after running the test by adding self.addCleanup.
--
Added file: http://bugs.python.org/file32130/add_x_mode_to_lzma_v3.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Vajrasky Kok added the comment:
Here is the patch to add the validation in simplefilter with the test.
--
keywords: +patch
nosy: +vajrasky
Added file: http://bugs.python.org/file32131/add_assert_in_simplefilter.patch
___
Python tracker rep
New submission from Vajrasky Kok:
./python Lib/wsgiref/simple_server.py
Serving HTTP on 0.0.0.0 port 8000 ...
127.0.0.1 - - [14/Oct/2013 17:23:43] GET /xyz?abc HTTP/1.1 200 4510
sys:1: ResourceWarning: unclosed socket.socket fd=4, family=2, type=1,
proto=0, laddr=('0.0.0.0', 8000)
Attached
Vajrasky Kok added the comment:
Hi, Senthil Kumaran, thank you for your review.
I have one small complain about your improved patch. Perhaps we need to give
security warning when they want to use allow_dotted_names feature in the
documentation. I omitted the warning in the demo because
Vajrasky Kok added the comment:
Added doc.
--
Added file: http://bugs.python.org/file32075/add_x_mode_to_bz2_v2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19223
Vajrasky Kok added the comment:
Added doc. Revamped the test. The patch did not cater to the order of modes
(wb is equal to bw?). I think that deserves a separate ticket.
--
Added file: http://bugs.python.org/file32077/add_x_mode_to_lzma_v2.patch
Vajrasky Kok added the comment:
Attached the patch to address Georg Brandl's concern (Thank you!). I also added
test for checking the comment of the object defined in C (list, open, etc). I
have given thought about testing the comment of the object in interactive
shell. But it is too much
Vajrasky Kok added the comment:
Added test.
--
keywords: +patch
nosy: +vajrasky
Added file: http://bugs.python.org/file32074/add_x_mode_to_bz2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19223
Vajrasky Kok added the comment:
Okay, I updated the patch. Now, it sends the datetime object instead of
formatted datetime string. Also, I used static method inside instance to let
the client uses dotted attribute feature instead of self attribute trick.
--
Added file: http
Vajrasky Kok added the comment:
Added the doc fix and modified the test.
--
Added file: http://bugs.python.org/file32057/issue16355_v3.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16355
Vajrasky Kok added the comment:
Nice.
My only complain is the dis.dis example. We don't have to use redirect_stdout
context manager.
+# How to capture disassembly to a string
+
+import dis
+import io
+
+f = io.StringIO()
+with redirect_stdout(f
Vajrasky Kok added the comment:
Here is the unit test for Tim Heaney's work. There is a test that explicitly
tests that we get error when opening in 'x' mode. Also, this test is only for
lzma. I think we should create separate tickets for other compression methods.
--
keywords: +patch
Changes by Vajrasky Kok sky@speaklikeaking.com:
Removed file: http://bugs.python.org/file32030/add_x_mode_to_lzma.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19201
Changes by Vajrasky Kok sky@speaklikeaking.com:
Added file: http://bugs.python.org/file32031/add_x_mode_to_lzma.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19201
Vajrasky Kok added the comment:
Attached the second version patch to address R. David Murray's concerns.
1. test_dotted_attribute name has been taken, so I use
test_instance_with_allow_dotted_names name. Or should I use
test_instance_with_dotted_attribute name? Or maybe
Vajrasky Kok added the comment:
Only doc fix? What about unit test confirming that getcomments and getsource
return None if inspect can not find the source code?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16355
New submission from Vajrasky Kok:
Currently, the test_current_time is idle because the server (time.xmlrpc.com)
that it requires is dead (at the moment being and no end in sight).
The patch moved the test from Lib/test/test_xmlrpc_net.py to
Lib/test/test_xmlrpc.py and simulate
Vajrasky Kok added the comment:
I have played around with this test.
The major issue (there are other issues as well but not so difficult) is
whether nlargest and nsmallest should support iterator that could be endless
iterator or reject it (by checking __len__ attribute) straight away.
Once
Vajrasky Kok added the comment:
I pep-8 Phil Connell's work and revamped the unit test based on R. David
Murray's request.
--
nosy: +vajrasky
Added file: http://bugs.python.org/file31975/issue16355_v2.diff
___
Python tracker rep...@bugs.python.org
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
New submission from Vajrasky Kok:
This is the test.
def test_keys(self):
d = {}
self.assertEqual(set(d.keys()), set())
d = {'a': 1, 'b': 2}
k = d.keys()
self.assertIn('a', d)
self.assertIn('b', d)
self.assertRaises(TypeError, d.keys
New submission from Vajrasky Kok:
from itertools import repeat
repeat(2, -10).__length_hint__()
0
repeat(2, times=-10).__length_hint__()
18446744073709551606
repeat(2, times=-10)
repeat(2, -10)
repeat(2, -10)
repeat(2, 0)
Hereby, I attached two alternatives of patch to make the behaviour
301 - 400 of 570 matches
Mail list logo