[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Gregory P. Smith
Changes by Gregory P. Smith g...@krypto.org: -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14028 ___ ___ Python-bugs-list

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Martin v . Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: -- versions: -Python 2.6, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14028 ___ ___

[issue13986] ValueError: cannot convert float NaN to integer

2012-02-16 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: FYI - A similar NaN appearing in an unexpected place (the random module in this case) bug that I just filed - http://bugs.python.org/issue14028. I don't actually know if these will be related or not. -- nosy: +gregory.p.smith

[issue2489] Patch for bugs in pty.py

2012-02-16 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 994659efa292 by Gregory P. Smith in branch '3.2': Issue #2489: Fix bug in _copy loop that could consume 100% cpu on EOF. http://hg.python.org/cpython/rev/994659efa292 New changeset c7338f62f956 by Gregory P. Smith

[issue2489] Patch for bugs in pty.py

2012-02-16 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: I'm keeping this open to address the added behavior for spawn in 3.3. -- assignee: - gregory.p.smith nosy: +gregory.p.smith stage: test needed - versions: +Python 3.3 -Python 2.7, Python 3.1, Python 3.2

[issue14029] When using setattr identifiers can start with any character

2012-02-16 Thread Lyudmil Nenov
New submission from Lyudmil Nenov lne...@mm-sol.com: I am not sure if this is actually a bug. Given documentation @ http://docs.python.org/release/2.5.2/ref/identifiers.html, the issue is that setattr does not appear to check identifier for naming convention. See a short example below.

[issue14025] unittest.TestCase.assertEqual does not show diff when comparing str with unicode

2012-02-16 Thread Jaap Karssenberg
Jaap Karssenberg jaap.karssenb...@gmail.com added the comment: On Thu, Feb 16, 2012 at 12:29 AM, Michael Foord rep...@bugs.python.orgwrote: The type check in assertEqual, that delegates to the different comparison methods, is strict because we can't know that using the error message

[issue14029] When using setattr identifiers can start with any character

2012-02-16 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: It's not a bug. The specification of identifiers refers only to the places where they appear in the language grammar, i.e. what you can put into source code. What parameters objects accept in __setattr__ is an entirely different question.

[issue14030] Be more careful about selecting the compiler in distutils

2012-02-16 Thread Dirkjan Ochtman
Changes by Dirkjan Ochtman dirk...@ochtman.nl: -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14030 ___ ___

[issue14030] Be more careful about selecting the compiler in distutils

2012-02-16 Thread Dirkjan Ochtman
New submission from Dirkjan Ochtman dirk...@ochtman.nl: distutils incorrectly handles CFLAGS as 1 argument instead of space-separated list of arguments. distutils should respect environment variables, which set compiler, linker etc. --- Lib/distutils/unixccompiler.py +++

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14028 ___ ___

[issue13986] ValueError: cannot convert float NaN to integer

2012-02-16 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: My guess would be not related. My best guess for this issue is that it's caused by some mismatch in the struct stat declarations / uses on MIPS / Linux. A Google search for MIPS and stat suggests that there are problems in this area.

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14028 ___ ___

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Hmm, this is a little odd. For 2.7 at least, the error message is coming from PyLong_FromDouble in Objects/longobject.c. I can't immediately see how PyLong_FromDouble could be called by the random seeding process. So it seems more likely

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: The bugs.launchpad.net URL shows a call to 'entropy.choice'. Any idea what 'entropy' is? Could it be that they're using their own Random subclass, not tied to the Python MT implementation? --

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: The hypothesis that time.time() is returning NaN doesn't match the provided traceback. If time.time() had returned NaN, the exception would have happened earlier, on line 113 in random.py: long(time.time() * 256) I'm wondering

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I'm wondering if the NaN arises in the C code for random(): I don't think that's possible. In the second line: return PyFloat_FromDouble((a*67108864.0+b)*(1.0/9007199254740992.0)); a and b are already C unsigned longs, so no matter

[issue12627] Implement PEP 394: The python Command on Unix-Like Systems

2012-02-16 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: Removed file: http://bugs.python.org/file22738/version33_links.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12627 ___

[issue12627] Implement PEP 394: The python Command on Unix-Like Systems

2012-02-16 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I removed the 3.3 patch, since all the previous version did was change symbolic links to hard links, and the latest round of discussions favoured retaining the symlinks since they're much easier to introspect. However, it turns out there is

[issue12627] Implement PEP 394: The python Command on Unix-Like Systems

2012-02-16 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Actually, the Python 3 Makefile.pre.in is currently broken if $(EXE) is ever non-empty - in a few places it uses $(PYTHON)$(VERSION)$(EXE) and $(PYTHON)3$(EXE). Those are wrong, because the definition of $(PYTHON) at the top of the file is

[issue12627] Implement PEP 394: The python Command on Unix-Like Systems

2012-02-16 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: New patch that aims to create the appropriate symlinks in make bininstall. I don't currently have a sacrificial VM set up to test it in though. -- Added file: http://bugs.python.org/file24530/pep394_python27_symlinks.diff

[issue12627] Implement PEP 394: The python Command on Unix-Like Systems

2012-02-16 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: Removed file: http://bugs.python.org/file22737/version27_links.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12627 ___

[issue13988] Expose the C implementation of ElementTree by default when importing ElementTree

2012-02-16 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: I'm still not sure that's the best option. Without deprecation people will keep using cElementTree and we will have to keep it around forever (or at least until Python4 and then have a 3to4 to fix the import). This might be fine, but as a

[issue14026] test_cmd_line_script should include more sys.argv checks

2012-02-16 Thread Jason Yeo
Changes by Jason Yeo jasonye...@gmail.com: -- nosy: +Jason.Yeo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14026 ___ ___ Python-bugs-list

[issue13210] Support Visual Studio 2010

2012-02-16 Thread Jack Jansen
Changes by Jack Jansen jackjan...@users.sourceforge.net: -- nosy: +jackjansen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13210 ___ ___

[issue14031] logging module cannot format str.format log messages

2012-02-16 Thread Guido Kollerie
New submission from Guido Kollerie gu...@kollerie.com: When logging messages with variable data one typically writes: username = 'Guido' logging.info('User %s logged in', username) However Python 3 has support str.format (PEP 3101). If one has adopted str.format for formatting strings

[issue14031] logging module cannot format str.format log messages

2012-02-16 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: That can't work. The logging messages may come from libraries written by someone else, using % formatting. The style has to be set at the individual logger level. -- nosy: +r.david.murray, vinay.sajip

[issue13892] distutils handling of windows manifest isn't optimal

2012-02-16 Thread Jack Jansen
Jack Jansen jackjan...@users.sourceforge.net added the comment: Indeed, my situation is different from the cscript.exe situation because in my case Python needs to call back into the hosting application. Further experiments have shown that this is indeed the problem, and moreover that this is

[issue14031] logging module cannot format str.format log messages

2012-02-16 Thread Guido Kollerie
Guido Kollerie gu...@kollerie.com added the comment: I see, could this be made to work if I explicitly request a logger instead?: logger = logging.getLogger('my_logger', style='{') logger.info('User {} logged in', username) Maybe even for the root logger: root_logger =

[issue14032] test_cmd_line_script prints undefined 'data' variable

2012-02-16 Thread Jason Yeo
New submission from Jason Yeo jasonye...@gmail.com: Hi, I'm new around here. I was trying to fix issue 14026 and I found this problem. In test_cmd_line_script, the test_issue8202 tries to print an undefined data variable when verbose is set to 1. I have a patch attached to print(out) instead

[issue14032] test_cmd_line_script prints undefined 'data' variable

2012-02-16 Thread Jason Yeo
Changes by Jason Yeo jasonye...@gmail.com: Added file: http://bugs.python.org/file24532/mypatch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14032 ___

[issue14032] test_cmd_line_script prints undefined 'data' variable

2012-02-16 Thread Jason Yeo
Changes by Jason Yeo jasonye...@gmail.com: Removed file: http://bugs.python.org/file24532/mypatch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14032 ___

[issue14033] distutils problem with setup.py build setup.py install vs direct setup.py install

2012-02-16 Thread 勇刚 罗
New submission from 勇刚 罗 luoyongg...@gmail.com: D:\CI\bld\vcsbuild-pygit2.bat D:\CI\bld\vcs\pygit2call python setup.py build call python setup.py install cd /d D:\CI\bld\vcs running build running build_py running build_ext building 'pygit2' extension creating build creating

[issue14031] logging module cannot format str.format log messages

2012-02-16 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Use instead the approach described in this post: http://plumberjack.blogspot.com/2010/10/supporting-alternative-formatting.html -- resolution: - out of date status: open - closed ___ Python

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: I think my claim the hardware appears healthy was premature. I misunderstood our initial error report internally on where the code ran and was looking at the wrong host. doh. my bad. Several more of these have been found in the last week

[issue14020] Improve HTMLParser doc

2012-02-16 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Do you remember how to do it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14020 ___

[issue12655] Expose sched.h functions

2012-02-16 Thread Matt Joiner
Matt Joiner anacro...@gmail.com added the comment: Please also expose sched_getcpu(). -- nosy: +anacrolix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12655 ___

[issue14034] the example in argparse doc is too complex

2012-02-16 Thread Tshepang Lekhonkhobe
New submission from Tshepang Lekhonkhobe tshep...@gmail.com: The argparse example (http://docs.python.org/dev/library/argparse.html#example) introduces way too many concepts too early. It's written as if targeted to existing users of optparse, instead of newcomers to Python's CLI handling.

[issue13878] test_sched failures on Windows buildbot

2012-02-16 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 662c60d26183 by Charles-François Natali in branch '3.2': Issue #13878: Fix random test_sched failures. http://hg.python.org/cpython/rev/662c60d26183 New changeset e35091b95813 by Charles-François Natali in branch

[issue13961] Have importlib use os.replace()

2012-02-16 Thread Charles-François Natali
Changes by Charles-François Natali neolo...@free.fr: -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13961 ___

[issue14024] logging.Formatter Cache Prevents Exception Format Overriding

2012-02-16 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: A number of points: 1. exc_text is not just an implementation detail - it's in the docs. Thus, removing the cache altogether would be backwards-incompatible. 2. The exc_text value is the only simple way of propagating the exception

[issue13609] Add os.get_terminal_size() function

2012-02-16 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I don't think there's much point in the proposed complications. If you're willing to know the terminal size, you're probably interested in displaying something in it (using stdout), so why would you care about stderr or stdin? --

[issue13609] Add os.get_terminal_size() function

2012-02-16 Thread Zbyszek Szmek
Zbyszek Szmek zbys...@in.waw.pl added the comment: Stdout can be connected to a pipe, e.g to less, which in turn might be connected to a terminal. The program can then display output properly scaled for the terminal, assuming that because stdin is connnected to a terminal, output will

[issue13878] test_sched failures on Windows buildbot

2012-02-16 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: Should be fixed now, thanks. -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13878

[issue13995] sqlite3 Cursor.rowcount documentation for old sqlite bug

2012-02-16 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 74b2da95c6be by Petri Lehtinen in branch '3.2': sqlite3: Fix documentation errors concerning Cursor.rowcount http://hg.python.org/cpython/rev/74b2da95c6be New changeset a1f17e108a1b by Petri Lehtinen in branch

[issue13995] sqlite3 Cursor.rowcount documentation for old sqlite bug

2012-02-16 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Fixed, thanks! -- nosy: +petri.lehtinen versions: +Python 2.7, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13995

[issue13641] decoding functions in the base64 module could accept unicode strings

2012-02-16 Thread Catalin Iacob
Catalin Iacob iacobcata...@gmail.com added the comment: Attached alternative patch with a different approach: on input, strings are encoded as bytes and the rest of the code proceeds as before. All existing tests for bytes now test for strings as well and there is a new test for strings with

RuntimeError: maximum recursion depth exceeded in cmp

2012-02-16 Thread OwenLJN
Hi I wrote a python function self_contained(x) that finds all lists in x that contain themselves. Here's the body of the function: def self_contained(x): L = [] if not isinstance(x, list): return [] for i in x: if isinstance(i, list): if i in i:

Re: RuntimeError: maximum recursion depth exceeded in cmp

2012-02-16 Thread OwenLJN
Let me restate my question:I want to make self_contained(L5) and self_contained(L6) work, but I get RuntimeError how can I fix this by adding one more parameter to check if a list inside a list was seen before, and then stop the loop to prevent the error message from showing again? And I found

[issue13641] decoding functions in the base64 module could accept unicode strings

2012-02-16 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Um. I'm inclined to think that #13637 was a mistake. Functions that accept bytes and return bytes and also accept string and return string seem uncontroversial. However, accepting bytes or string and returning bytes is not an

[issue13641] decoding functions in the base64 module could accept unicode strings

2012-02-16 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: However, accepting bytes or string and returning bytes is not an obviously good idea, and IMO at least merits some discussion. Why? a in a2b means ASCII, and unicode is as valid a container for ASCII text as bytes is. --

[issue9631] Python 2.7 installation issue for Linux gcc-4.1.0-3 (Fedora Core 5?)

2012-02-16 Thread miro ilias
miro ilias miroslav.il...@umb.sk added the comment: Hi, with the fresh downloadable version of Python 2.7.2 I got the same error. /usr/bin/install -c -m 644 ./Lib/curses/wrapper.py /home/ilias/bin/python_static/lib/python2.7/curses /usr/bin/install -c -m 644 ./Lib/pydoc_data/__init__.py

[issue14035] behavior of test.support.import_fresh_module

2012-02-16 Thread Florent Xicluna
New submission from Florent Xicluna florent.xicl...@gmail.com: While writing tests xml.etree, I hit a strange behaviour of import_fresh_module. How to reproduce: - dummy/__init__.py - dummy/foo.py - dummy/bar.py - test_fresh_import.py # 'dummy/foo.py' from dummy.bar import func #

[issue13641] decoding functions in the base64 module could accept unicode strings

2012-02-16 Thread poq
poq p...@gmx.com added the comment: FWIW, I was surprised by the return type of b64encode when I first used it in Python 3. It seems to me that b64encode turns binary data into text and thus intuitively should take bytes and return str. Similarly it seems intuitive to me for b64decode to take

[issue14035] behavior of test.support.import_fresh_module

2012-02-16 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14035 ___ ___

[issue13641] decoding functions in the base64 module could accept unicode strings

2012-02-16 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: OK, I skimmed the thread I was remembering, and while it was discussing str-str and bytes-bytes primarily, the only pronouncement I could find was that functions should not accept a *mix* of bytes and string. So I guess I withdraw my

[issue7652] Merge C version of decimal into py3k.

2012-02-16 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: STINNER Victor rep...@bugs.python.org wrote: decimal.Decimal.__truediv__() has an optional context argument, whereas _decimal defines PyNumberMethods. Regarding the special methods: decimal.py uses the optional context arguments for

[issue7652] Merge C version of decimal into py3k.

2012-02-16 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: I walked into the Roundup trap again: Decimal(9).quantize(1, ?!?!?) Decimal('9') -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7652

[issue10513] sqlite3.InterfaceError after commit

2012-02-16 Thread Anders Blomdell
Anders Blomdell anders.blomd...@control.lth.se added the comment: So my suggestion is to remove in pysql_connection_commit the call to : pysqlite_do_all_statements(self, ACTION_RESET, 0); to bring back the correct old behavior. That's what I have been running for years, now... And also

[issue13089] parsetok.c: memory leak

2012-02-16 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: Yes, that's basically what I did, but using the latest revision I cannot reproduce the parsetok leak either. The atexit leak is an old friend (#11826), so I think we can close this one for now. -- resolution: - out of date

[issue2377] Replace __import__ w/ importlib.__import__

2012-02-16 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: Just a quick update. I have refactored importlib in the cpython repo to allow for implementing bits of importlib.__import__() and importlib._gcd_import() in C. This means that the built-in __import__() is now calling importlib underneath the

[issue2377] Replace __import__ w/ importlib.__import__

2012-02-16 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: Add Nick since the refactoring of importlib.__import__() into functions was his idea. -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2377

[issue14036] urlparse insufficient port property validation

2012-02-16 Thread zulla
New submission from zulla d...@defendassist.com: The port component of a URL is not properly be sanitized or validated. This may lead to the evasion of netloc/hostname based filters or exceptions. -- components: Library (Lib) files: testurllib.py messages: 153512 nosy: zulla priority:

[issue14035] behavior of test.support.import_fresh_module

2012-02-16 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com added the comment: Trigger the same behavior without import_fresh_module. (test_fresh_import2.py) If you uncomment line #A or #B, it succeed. On the other side, if you comment line #C or #D, it succeed too. The import machinery is a bit complex, indeed

[issue14038] Packaging test support code raises exception

2012-02-16 Thread Vinay Sajip
New submission from Vinay Sajip vinay_sa...@yahoo.co.uk: test_packaging has started failing in the pythonv branch: == ERROR: test_old_record_extensions (packaging.tests.test_command_install_dist.InstallTestCase)

[issue14037] Allow grouping of argparse subparser commands in help output

2012-02-16 Thread Nick Coghlan
New submission from Nick Coghlan ncogh...@gmail.com: I've just started using the argparse subparser feature, and it's very nice. However, I'd love to be able to group the different subparser commands into different sections the way I can group ordinary arguments with add_argument_group().

[issue14039] Add metavar argument to add_subparsers() in argparse

2012-02-16 Thread Nick Coghlan
New submission from Nick Coghlan ncogh...@gmail.com: Currently, using add_subparsers() means that the entire list of subcommands is added to the main usage message. This gets rather unwieldy when there are a lot of subcommands. It would be nice if the add_subparsers() method accepted a

[issue14037] Allow grouping of argparse subparser commands in help output

2012-02-16 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I realised that my initial idea doesn't play nicely with my other suggestion of allowing a metavar argument to add_subparsers() (see #14039). A better model may be to mimic the add_argument_group() directly by offering an add_parser_group()

[issue14025] unittest.TestCase.assertEqual does not show diff when comparing str with unicode

2012-02-16 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: If you really want the diff you could use assertMultiLineEqual, but even on Python 2 you shouldn't mix str and unicode. I would rather fix the code to return unicode than using assertMultilineEqual to get a diff between str and unicode.

[issue14035] behavior of test.support.import_fresh_module

2012-02-16 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com added the comment: Keeping reference of fresh modules solves the issue. -- keywords: +patch stage: - patch review Added file: http://bugs.python.org/file24537/issue14035_fresh_modules.diff ___ Python tracker

[issue13882] PEP 410: Use decimal.Decimal type for timestamps

2012-02-16 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: Patch version 18: - Fix a loss of precision in _PyTime_SetDenominator() - Add more tests on integer overflow I also updated the patch adding datetime.datetime support because some people are interested by the type, even I don't think

[issue13882] PEP 410: Use decimal.Decimal type for timestamps

2012-02-16 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: Removed file: http://bugs.python.org/file24505/time_decimal-17.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13882 ___

[issue13882] PEP 410: Use decimal.Decimal type for timestamps

2012-02-16 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: Added file: http://bugs.python.org/file24539/timestamp_datetime-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13882 ___

[issue13882] PEP 410: Use decimal.Decimal type for timestamps

2012-02-16 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: Removed file: http://bugs.python.org/file24414/timestamp_datetime.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13882 ___

[issue14028] random.choice hits ValueError: cannot convert float NaN to integer

2012-02-16 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Well, at least it was an interesting bug report ;-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14028 ___

[issue14036] urlparse insufficient port property validation

2012-02-16 Thread zulla
zulla d...@defendassist.com added the comment: The port and netloc component of a ParsedResult-object is not properly sanitized or validated. This may lead to bypass-able hostname-based filters. Remote Crash vulnerabilities be be also possible. --

[issue14036] urlparse insufficient port property validation

2012-02-16 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Did you upload urlparse.py to the issue by accident? Can you please provide some examples of where you think the current code is producing incorrect results? -- nosy: +r.david.murray ___

[issue14036] urlparse insufficient port property validation

2012-02-16 Thread zulla
zulla d...@defendassist.com added the comment: Hi. No, it's a patched version. It won't crash under circumstances like that [1] and won't succeed with invalid input: import urlparse urlparse.urlparse(http://www.google.com:foo;) ParseResult(scheme='http', netloc='www.google.com:foo',

[issue14036] urlparse insufficient port property validation

2012-02-16 Thread zulla
zulla d...@defendassist.com added the comment: Whops. I forgot an int() :-) Here's the right patch. -- Added file: http://bugs.python.org/file24540/testurllib.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14036

[issue14036] urlparse insufficient port property validation

2012-02-16 Thread zulla
Changes by zulla d...@defendassist.com: Removed file: http://bugs.python.org/file24535/urlparse.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14036 ___

[issue14026] test_cmd_line_script should include more sys.argv checks

2012-02-16 Thread Jason Yeo
Jason Yeo jasonye...@gmail.com added the comment: I would like to work on this but I am not sure how to go about it. It seems that the method signature for _check_script has to be changed in include another parameter for expected_argv1, expected_argv2, etc. The _check_output also has to be

[issue14036] urlparse insufficient port property validation

2012-02-16 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: It's not a patch if it is the whole file. A diff would be much more useful, since then we could see the changes easily. This kind of change would require a bit of discussion. I'm doubtful that it would be applied as a bug fix, and we

[issue14036] urlparse insufficient port property validation

2012-02-16 Thread zulla
zulla d...@defendassist.com added the comment: I understand your point of view, but I disagree. Various libraries and projects rely on urlparse.urlparse and urllib.parse.urlparse. This bug just blew up in my face. I'm working with Cython and PyQt4. When a developer relies on

[issue14035] behavior of test.support.import_fresh_module

2012-02-16 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Keeping module references implicitly in import_fresh_module will leak references like crazy in the test suite. The onus is on the code referencing module contents to ensure that the module globals remain valid. If we get rid of the explicit

[issue812369] module shutdown procedure based on GC

2012-02-16 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: In #14035, Florent pointed out the current behaviour potentially causes problems for some uses of import_fresh_modules() in the test suite (with globals sometimes being set to None if there's no indepenent reference to the module). GC based

[issue14035] behavior of test.support.import_fresh_module

2012-02-16 Thread Eli Bendersky
Eli Bendersky eli...@gmail.com added the comment: Florent, I can reproduce the problem by leaving just the last import_fresh_module in test_fresh_import.py And your patch fixes it, although as Nick says it's problematic in terms of ref leaks. What I'm not sure about is why the extra

[issue13598] string.Formatter doesn't support empty curly braces {}

2012-02-16 Thread Ramchandra Apte
Ramchandra Apte maniandra...@gmail.com added the comment: @Nick I don't understand why should my patch make Formatter thread-unsafe - the auto_field_count and manual variables are local variables just like the variables in the other functions in Formatter. --

[issue13598] string.Formatter doesn't support empty curly braces {}

2012-02-16 Thread Ramchandra Apte
Ramchandra Apte maniandra...@gmail.com added the comment: I have submitted a new patch, I have moved the increment to the end of if loop. -- Added file: http://bugs.python.org/file24542/issue13598.diff ___ Python tracker rep...@bugs.python.org

[issue812369] module shutdown procedure based on GC

2012-02-16 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue812369 ___ ___ Python-bugs-list