[issue23765] Remove IsBadStringPtr calls in ctypes

2015-03-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 585e555247ac by Steve Dower in branch 'default': Issue #23765: Remove IsBadStringPtr calls in ctypes https://hg.python.org/cpython/rev/585e555247ac -- nosy: +python-dev ___ Python tracker

[issue23314] Disabling CRT asserts in debug build

2015-03-25 Thread Steve Dower
Steve Dower added the comment: I haven't seen any of these in a while, and the buildbot at http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x (the only one running VS 2015 right now AFAIK) hasn't either, so I'm calling this fixed. -- resolution: - fixed status: open -

[issue23763] Chain exceptions in C

2015-03-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it would be safer to defer automatically chaining exceptions to 3.6. After releasing 3.5 we can got reports about exceptions ignored by mistake. After fixing all bugs not covered by the testsuite, we could try automatically chain exceptions. May be

[issue23773] importlib does not properly remove frames when invoking external import hooks

2015-03-25 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +brett.cannon stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23773 ___ ___

[issue23546] Windows, 'Edit withIDLE', and multiple installed versions

2015-03-25 Thread Steve Dower
Steve Dower added the comment: I've committed a change that adds a submenu for IDLE almost exactly like Liam's mockup. Thanks for pushing me on this, I probably wouldn't have worked this hard to get something as robust otherwise :) -- ___ Python

[issue23765] Remove IsBadStringPtr calls in ctypes

2015-03-25 Thread Steve Dower
Changes by Steve Dower steve.do...@microsoft.com: -- resolution: - fixed stage: needs patch - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23765 ___

Re: Newbie looking for elegant solution

2015-03-25 Thread Rustom Mody
On Wednesday, March 25, 2015 at 11:23:08 AM UTC+5:30, Paul Rubin wrote: kai.peters writes 1 bit images of a size of 1024 x 1280 need to be processed this way, so 1310720 list elements. Also needs to be 2.7 only. Where are these lists going to come from? Files? Process the file

[issue23465] Implement PEP 486 - Make the Python Launcher aware of virtual environments

2015-03-25 Thread Steve Dower
Changes by Steve Dower steve.do...@microsoft.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23465 ___

[issue9445] Fix undefined symbol errors on VS8.0 build

2015-03-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset d094eeeb1496 by Steve Dower in branch 'default': Closes #9445: Removes detection of GetFinalPathNameByHandle https://hg.python.org/cpython/rev/d094eeeb1496 -- nosy: +python-dev stage: patch review - resolved status: open - closed

[issue23619] Python 3.5.0a2 installer fails on Windows

2015-03-25 Thread Steve Dower
Steve Dower added the comment: Migrated the test failures to #23774 and closing this. -- resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23619

[issue19351] python msi installers - silent mode

2015-03-25 Thread Steve Dower
Steve Dower added the comment: I'm not exactly sure how msiexec does its parsing, but it's possible that ALLUSERS=1 may not actually be the same as ALLUSERS=1. I use the latter regularly with most versions of Python in existence and it works fine. There may also be problems upgrading from the

Re: Newbie looking for elegant solution

2015-03-25 Thread Dave Farrance
otaksoftspamt...@gmail.com wrote: I have a list containing 9600 integer elements - each integer is either 0 or 1. Starting at the front of the list, I need to combine 8 list elements into 1 by treating them as if they were bits of one byte with 1 and 0 denoting bit on/off (the 8th element would

[issue23774] Test failures when unable to write to install location

2015-03-25 Thread Steve Dower
New submission from Steve Dower: The following tests fail when run in an all-users installation because they cannot write to the install directory: test_compileall test_tcl test_tools test_zipfile See the attached file for traces. From Ned Deily: Regarding tests trying to write into the

[issue22904] make profile-opt includes -fprofile* flags in _sysconfigdata CFLAGS

2015-03-25 Thread Ned Deily
Ned Deily added the comment: Slavek, this issue and its superseder are both closed so comments here will likely not be acted on. -- nosy: +ned.deily stage: needs patch - resolved ___ Python tracker rep...@bugs.python.org

[issue23767] Library and include paths not added when cross compiling on localized sytem

2015-03-25 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +doko stage: - patch review versions: +Python 2.7, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23767 ___

[issue23573] Avoid redundant allocations in str.find and like

2015-03-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Many thanks Victor for fixing crashes. Unfortunately I couldn't reproduce a crash on my computers, perhaps it is was 64-bit only. Yes, I'll look how the code can be optimized. -- ___ Python tracker

[issue21319] WindowsRegistryFinder never added to sys.meta_path

2015-03-25 Thread Steve Dower
Steve Dower added the comment: I've seen some module paths be registered there, but no, it doesn't really get used much (maybe because it's been broken?) os.name is certainly the right test here. FWIW, I'd rather be prioritising file system over registry for finding packages anyway. It makes

[issue21717] Exclusive mode for ZipFile and TarFile

2015-03-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset b2a8c30d8ddb by Serhiy Storchaka in branch 'default': Issue #21717: The zipfile.ZipFile.open function now supports 'x' (exclusive https://hg.python.org/cpython/rev/b2a8c30d8ddb -- ___ Python tracker

[issue20181] Derby #12: Convert 50 sites to Argument Clinic across 4 files

2015-03-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The only difference is in error message. For now: unicodedata.name(123) Traceback (most recent call last): File stdin, line 1, in module TypeError: must be str, not int unicodedata.name('123') Traceback (most recent call last): File stdin, line 1, in

[issue23774] Test failures when unable to write to install location

2015-03-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is a guard for zipfile tests (requiresWriteAccess). The question is why it doesn't work for this test but works for other tests. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org

Re: Daylight savings time question

2015-03-25 Thread Chris Angelico
On Wed, Mar 25, 2015 at 10:18 AM, Carl Meyer c...@oddbird.net wrote: US/Pacific is an alias for America/Los_Angeles, and is also part of the Olson database (though I guess it's considered an old name for the timezone): https://github.com/eggert/tz/blob/master/backward Ah, okay. No problem

[issue23775] Fix pprint of OrderedDict

2015-03-25 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Currently pprint prints the repr of OrderedDict if it fits in one line, and prints the repr of dict if it is wrapped. import collections, pprint pprint.pprint(collections.OrderedDict([(4, 3), (2, 1)])) OrderedDict([(4, 3), (2, 1)])

[issue20181] Derby #12: Convert 50 sites to Argument Clinic across 4 files

2015-03-25 Thread Larry Hastings
Larry Hastings added the comment: I read it quickly. It looks basically okay, but I have one issue to discuss right now. Changing from the format unit 'O!' and calling getuchar to the format unit 'C' means a change in semantics. The text in the exception will change. Unfortunately, people

[issue23763] Chain exceptions in C

2015-03-25 Thread STINNER Victor
STINNER Victor added the comment: Le mercredi 25 mars 2015, Serhiy Storchaka rep...@bugs.python.org a écrit : I think it would be safer to defer automatically chaining exceptions to 3.6. After releasing 3.5 we can got reports about exceptions ignored by mistake. Hum, what change can ignore

Re: Daylight savings time question

2015-03-25 Thread Carl Meyer
Hi Dan, On 03/24/2015 04:24 PM, Dan Stromberg wrote: Is there a way of adding 4 hours and getting a jump of 5 hours on March 8th, 2015 (due to Daylight Savings Time), without hardcoding when to spring forward and when to fall back? I'd love it if there's some library that'll do this for me.

[issue21717] Exclusive mode for ZipFile and TarFile

2015-03-25 Thread Berker Peksag
Berker Peksag added the comment: LGTM. I left two minor comments on Rietveld. Sorry for the delay. -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21717

[issue21717] Exclusive mode for ZipFile and TarFile

2015-03-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21717 ___

Re: Daylight savings time question

2015-03-25 Thread Carl Meyer
On 03/24/2015 04:56 PM, Chris Angelico wrote: On Wed, Mar 25, 2015 at 9:24 AM, Dan Stromberg drsali...@gmail.com wrote: Is there a way of adding 4 hours and getting a jump of 5 hours on March 8th, 2015 (due to Daylight Savings Time), without hardcoding when to spring forward and when to fall

[issue23769] valgrind reports leaks for test_zipimport

2015-03-25 Thread Robert Kuska
Robert Kuska added the comment: I tried leak2.py with valgrind, I've uncommented the lines you mentioned. $ valgrind python3 leak2.py

[issue23776] Don't use assert for checking arguments in pprint

2015-03-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Similar issues are issue8361 and issue17840. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23776 ___ ___

[issue23777] argparse subcommand action can't be specified

2015-03-25 Thread SpaceOne
New submission from SpaceOne: parser.add_subparsers(dest='arguments', action='append') will raise the following exception: File /usr/lib/python2.7/argparse.py, line 1675, in add_subparsers action = parsers_class(option_strings=[], **kwargs) TypeError: __init__() got an unexpected keyword

[issue21319] WindowsRegistryFinder never added to sys.meta_path

2015-03-25 Thread Paul Moore
Paul Moore added the comment: I think the main (only?) user of having sys.path entries in the registry is pywin32. It might be worth asking them if they can switch to a more mainstream approach, and then maybe the whole registry finder thing can be removed completely. -- nosy:

[issue23712] Experiment: Assume that exact unicode hashes are perfect discriminators

2015-03-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: Given interned strings can already be compared by pointer, I'd recommend people call sys.intern() on their strings if they want really fast equality comparisons. -- nosy: +pitrou, tim.peters ___ Python tracker

[issue23775] Fix pprint of OrderedDict

2015-03-25 Thread Alexei Romanov
Changes by Alexei Romanov drednout...@gmail.com: -- nosy: +alexei.romanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23775 ___ ___

[issue23765] Remove IsBadStringPtr calls in ctypes

2015-03-25 Thread eryksun
eryksun added the comment: c_char_p.__repr__ (defined in __init__.py) also checks IsBadStringPtrA via FFI. Defining the repr differently on Windows is a wart, IMO. The following repr should be used on all platforms for c_char_p: %s(%s) % (self.__class__.__name__,

[issue23776] Don't use assert for checking arguments in pprint

2015-03-25 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: The assert statement should be used only for checking internal logic, and not for checking user data. These assertions should be either removed or converted into explicit raising ValueError. -- components: Library (Lib) messages: 239241 nosy:

[issue23776] Don't use assert for checking arguments in pprint

2015-03-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file38685/pprint_args_check.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23776

[issue23776] Don't use assert for checking arguments in pprint

2015-03-25 Thread Berker Peksag
Berker Peksag added the comment: Looks good. Two things: * I'd apply this only to the default branch. Changing exceptions from AssertionError to ValueError in bugfix releases may break third party code. I couldn't find a similar bug report in the tracker, so it's probably not worth to take

[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File

2015-03-25 Thread Martin Panter
Martin Panter added the comment: Another behaviour change in v7 is the seekable() return value is now inherited from underlying file, instead of always being True. I mentioned on Reitveld why this could be a bad idea, but as it is undocumented and untested and will leave the new behaviour

[issue23712] Experiment: Assume that exact unicode hashes are perfect discriminators

2015-03-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I wouldn't make this the default, since the probability is small, but not zero. However, it may be worth exploring this as dict sub-type for applications to use which could benefit from it. For internal strings, we already use interning, so no win there.

[issue23743] Python crashes upon exit if importing g++ compiled mod after importing gcc compiled mod

2015-03-25 Thread R. David Murray
R. David Murray added the comment: Well, clearly you are the interested party that solved it :) Thanks. Unfortunately I don't know that we have a place where this could be documented, since currently mingw isn't a fully supported platform. Perhaps in the distutils docs somewhere?

Python 2.7 issue with decimal value 0.0

2015-03-25 Thread Larry Martell
I have an app that works with 2.6, but in 2.7 it is failing. I traced it down to an issue with decimal.Decimal being passed a value of 0.0. It 2.6 this is fine, but in 2.7 it throws an exception: TypeError: Cannot convert float to Decimal. First convert the float to a string This is easy enough

Re: Python 2.7 issue with decimal value 0.0

2015-03-25 Thread Oscar Benjamin
On 25 March 2015 at 14:20, Larry Martell larry.mart...@gmail.com wrote: I have an app that works with 2.6, but in 2.7 it is failing. I traced it down to an issue with decimal.Decimal being passed a value of 0.0. It 2.6 this is fine, but in 2.7 it throws an exception: TypeError: Cannot convert

[issue20160] broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2015-03-25 Thread Bob
Bob added the comment: What I see is that structs lager that 8 bytes are not passed correctly to a callback funtion. I've attached a patchfile that includes my fix and a test to demonstrate the problem. -- Added file: http://bugs.python.org/file38687/large_struct_callback.patch

[issue23766] json.dumps: solidus (/) should be escaped

2015-03-25 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- resolution: - duplicate stage: - resolved status: open - closed superseder: - json encoder does not support JSONP/JavaScript safe escaping ___ Python tracker rep...@bugs.python.org

Re: Python 2.7 issue with decimal value 0.0

2015-03-25 Thread Grant Edwards
On 2015-03-25, Larry Martell larry.mart...@gmail.com wrote: I have an app that works with 2.6, but in 2.7 it is failing. I traced it down to an issue with decimal.Decimal being passed a value of 0.0. It 2.6 this is fine, but in 2.7 it throws an exception: TypeError: Cannot convert float to

[issue23765] Remove IsBadStringPtr calls in ctypes

2015-03-25 Thread Steve Dower
Steve Dower added the comment: Thanks, I forgot to scan .py files. -- status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23765 ___

[issue23712] Experiment: Assume that exact unicode hashes are perfect discriminators

2015-03-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In case of class or module dicts attribute names usually are interned. So no string comparison is needed if the key is found. It is needed only when the key is not found, but found a key with the same hash (with the chance 5e-28). The benefit of

[issue23773] importlib does not properly remove frames when invoking external import hooks

2015-03-25 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- assignee: - brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23773 ___ ___

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-03-25 Thread Cyd Haselton
Cyd Haselton added the comment: Ryan, From where do you want me to download Python for testing? I'm assuming I need to test by a) downloading an unpatched 3.4.2, b) applying patches, c) running ./configure make make install.. If this is not correct let me know --

[issue23764] functools.wraps should be able to change function argspec as well

2015-03-25 Thread Nick Coghlan
Nick Coghlan added the comment: Correctly processing a function's signature involves following the __wrapped__ chains to get to the underlying callable (or to a callable that defines an explicitly modified __signature__ value). inspect.signature follows these chains automatically, and in 3.4+

[issue23764] functools.wraps should be able to change function argspec as well

2015-03-25 Thread R. David Murray
R. David Murray added the comment: I think you need to explain exactly what it is you are looking for, because it doesn't seem to me that you can change the argspec of a function. What is it that decorator is doing that is helpful? -- ___ Python

[issue23774] Test failures when unable to write to install location

2015-03-25 Thread R. David Murray
R. David Murray added the comment: We need a buildbot that runs tests on an installed python. The general problem is not windows-only. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23774

Re: Python 2.7 issue with decimal value 0.0

2015-03-25 Thread Tim Golden
On 25/03/2015 14:29, Oscar Benjamin wrote: On 25 March 2015 at 14:20, Larry Martell larry.mart...@gmail.com wrote: I have an app that works with 2.6, but in 2.7 it is failing. I traced it down to an issue with decimal.Decimal being passed a value of 0.0. It 2.6 this is fine, but in 2.7 it

Re: PiCxx

2015-03-25 Thread Neal Becker
π wrote: Hello Python people, I've made a C++ wrapper for Python. I've called it PiCxx and put it up here: https://github.com/p-i-/PiCxx https://github.com/p-i-/PiCxx That project runs out of the box on OS X and should be pretty easy to adapt for other OS. Any help providing demo

[issue23742] expandvars removes single quotes ( ' )

2015-03-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9f4d2bdced9c by Serhiy Storchaka in branch '2.7': Issue #23742: ntpath.expandvars() no longer loses unbalanced single quotes. https://hg.python.org/cpython/rev/9f4d2bdced9c New changeset 613c4bd1c29c by Serhiy Storchaka in branch '3.4': Issue

[issue23778] Add a visual distinction to multiline versionchanged blocks

2015-03-25 Thread Demian Brecht
New submission from Demian Brecht: This came up during #2211, where a multiline versionchanged entry was suggested. Currently, there is no visual distinction between any but the first line of the description and the rest of the body of the docs. The attached patch adds a consistent level of

PiCxx

2015-03-25 Thread π
Hello Python people, I've made a C++ wrapper for Python. I've called it PiCxx and put it up here: https://github.com/p-i-/PiCxx https://github.com/p-i-/PiCxx That project runs out of the box on OS X and should be pretty easy to adapt for other OS. Any help providing demo projects for other

Re: Python 2.7 issue with decimal value 0.0

2015-03-25 Thread Larry Martell
On Wed, Mar 25, 2015 at 10:44 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Wed, Mar 25, 2015 at 8:36 AM, Larry Martell larry.mart...@gmail.com wrote: On Wed, Mar 25, 2015 at 8:26 AM, Grant Edwards invalid@invalid.invalid wrote: On 2015-03-25, Larry Martell larry.mart...@gmail.com wrote: I

Re: Python 2.7 issue with decimal value 0.0

2015-03-25 Thread Ian Kelly
On Wed, Mar 25, 2015 at 8:36 AM, Larry Martell larry.mart...@gmail.com wrote: On Wed, Mar 25, 2015 at 8:26 AM, Grant Edwards invalid@invalid.invalid wrote: On 2015-03-25, Larry Martell larry.mart...@gmail.com wrote: I have an app that works with 2.6, but in 2.7 it is failing. I traced it

[issue2211] Cookie.Morsel interface needs update

2015-03-25 Thread Demian Brecht
Demian Brecht added the comment: it would be better to consolidate the three adjacent versionchanged entries into one I created the three versionchanged items because there's no visual distinction between the second and third lines and the rest of the doc tests in the rendered output. I've

Re: Daylight savings time question

2015-03-25 Thread random832
On Tue, Mar 24, 2015, at 18:24, Dan Stromberg wrote: Is there a way of adding 4 hours and getting a jump of 5 hours on March 8th, 2015 (due to Daylight Savings Time), without hardcoding when to spring forward and when to fall back? I'd love it if there's some library that'll do this for me.

[issue2211] Cookie.Morsel interface needs update

2015-03-25 Thread Demian Brecht
Demian Brecht added the comment: FWIW, I created #23778 to address the indentation issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___

[issue23743] Python crashes upon exit if importing g++ compiled mod after importing gcc compiled mod

2015-03-25 Thread Steve Dower
Steve Dower added the comment: I think these days as soon as a repro includes import distutils or import setuptools the docs go straight to http://pypa.io :) -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org

Re: Python 2.7 issue with decimal value 0.0

2015-03-25 Thread Larry Martell
On Wed, Mar 25, 2015 at 8:26 AM, Grant Edwards invalid@invalid.invalid wrote: On 2015-03-25, Larry Martell larry.mart...@gmail.com wrote: I have an app that works with 2.6, but in 2.7 it is failing. I traced it down to an issue with decimal.Decimal being passed a value of 0.0. It 2.6 this is

[issue23742] expandvars removes single quotes ( ' )

2015-03-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23742 ___

[issue21319] WindowsRegistryFinder never added to sys.meta_path

2015-03-25 Thread Tim Golden
Tim Golden added the comment: I think they stopped using them a while back in favour of a pywin32.pth file. I don't think I even knew you could use the registry for sys.path. If no-one's shouted since the changes to importlib (which was 3.3?) I think we can quietly drop this and hope no-one

[issue21319] WindowsRegistryFinder never added to sys.meta_path

2015-03-25 Thread Tim Golden
Tim Golden added the comment: Adding Mark Hammond in case I'm wrong about the (lack of) impact on pywin32 -- nosy: +mhammond ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21319 ___

Re: Regex Python Help

2015-03-25 Thread Gregg Dotoli
No worries Steven, Thanks to ALL on this thread. Gregg On Tuesday, March 24, 2015 at 9:43:58 PM UTC-4, Steven D'Aprano wrote: On Wed, 25 Mar 2015 05:13 am, gdot...@gmail.com wrote: The error is: SyntaxError: Missing parentheses in call to 'print' I cannot imagine how the

[issue2211] Cookie.Morsel interface needs update

2015-03-25 Thread R. David Murray
R. David Murray added the comment: The body of the versionchanged has to be a single paragraph (no blank lines). Usually we start each sentence on a newline in the source, but it comes out rendered as a single flowed paragraph. Perhaps eventually someone will add support to Sphinx for

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-03-25 Thread Ryan Gonzalez
Ryan Gonzalez added the comment: No; you need the CPython tip. You can use https://github.com/python/cpython. Other than that, it's the configure+make thing. As I said before, the pyconfig.h changes aren't there yet. Trying to figure out how I want to approach those. --

[issue23778] Add a visual distinction to multiline versionchanged blocks

2015-03-25 Thread R. David Murray
R. David Murray added the comment: Heh, you clearly know more about docutils/css than I do. I don't think we want multiple blank delimited paragraphs under a versionchanged directive, though, from a style point of view. A compact unordered list would be best. -- nosy: +georg.brandl,

Supply condition in function call

2015-03-25 Thread Manuel Graune
Hi, I'm looking for a way to supply a condition to an if-statement inside a function body when calling the function. I can sort of get what I want with using eval (see code below) but I would like to achieve this in a safer way. If there is a solution which is safer while being less flexible,

[issue8800] add threading.RWLock

2015-03-25 Thread Dan O'Reilly
Changes by Dan O'Reilly oreil...@gmail.com: -- nosy: +dan.oreilly ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8800 ___ ___ Python-bugs-list

Re: Supply condition in function call

2015-03-25 Thread Manuel Graune
Joel Goldstick joel.goldst...@gmail.com writes: On Wed, Mar 25, 2015 at 1:29 PM, Manuel Graune manuel.gra...@koeln.de wrote: def test1(a, b, condition=True): for i,j in zip(a,b): c=i+j if eval(condition): print(Foo) I'm not sure I understand your question,

[issue23546] Windows, 'Edit withIDLE', and multiple installed versions

2015-03-25 Thread Liam Marsh
Liam Marsh added the comment: thank you for all this hard work. really. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23546 ___ ___

Re: Function Defaults - avoiding unneccerary combinations of arguments at input

2015-03-25 Thread Ian Kelly
On Wed, Mar 25, 2015 at 11:43 AM, Ivan Evstegneev webmailgro...@gmail.com wrote: Hello all , Just a little question about function's default arguments. Let's say I have this function: def my_fun(history=False, built=False, current=False, topo=None, full=False, file=None): if

[issue23487] argparse: add_subparsers 'action' broken

2015-03-25 Thread paul j3
paul j3 added the comment: OK, so you are thinking about what happens to the subparsers `dest` when the user names a command. That isn't handled by the `store` action, but by the call of the subparsers action class _SubParsersAction(Action): def __call__

Re: Supply condition in function call

2015-03-25 Thread Joel Goldstick
On Wed, Mar 25, 2015 at 1:29 PM, Manuel Graune manuel.gra...@koeln.de wrote: Hi, I'm looking for a way to supply a condition to an if-statement inside a function body when calling the function. I can sort of get what I want with using eval (see code below) but I would like to achieve this in

[issue23778] Add a visual distinction to multiline versionchanged blocks

2015-03-25 Thread Demian Brecht
Demian Brecht added the comment: Sounds good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23778 ___ ___ Python-bugs-list mailing list

Re: Supply condition in function call

2015-03-25 Thread Ian Kelly
On Wed, Mar 25, 2015 at 11:29 AM, Manuel Graune manuel.gra...@koeln.de wrote: Hi, I'm looking for a way to supply a condition to an if-statement inside a function body when calling the function. I can sort of get what I want with using eval (see code below) but I would like to achieve this in

[issue23778] Add a visual distinction to multiline versionchanged blocks

2015-03-25 Thread Demian Brecht
Demian Brecht added the comment: I noted in #2211 that nested lists are supported by Sphinx, so that solves that specific issue. Perhaps it /may/ still be useful to have this though in order to support multiple paragraphs for more detailed change descriptions when needed? That said, I'm not

[issue23487] argparse: add_subparsers 'action' broken

2015-03-25 Thread paul j3
paul j3 added the comment: As to the nature of the error when 'add_subparsers' is given an 'action' parameter: 'add_subparsers' does several things to 'kwargs' before it passes them to the relevant Action class. def add_subparsers(self, **kwargs): # adds 'parser_class' #

[issue2211] Cookie.Morsel interface needs update

2015-03-25 Thread Berker Peksag
Berker Peksag added the comment: I think David's suggestion in msg239260 was good enough for now :) You'll need to create a custom versionchanged directive to generate a valid and semantic markup for the usage in http_cookies_morsel_deprecated_set_2.patch. I also left a couple comments on

[issue23778] Add a visual distinction to multiline versionchanged blocks

2015-03-25 Thread R. David Murray
R. David Murray added the comment: Yes, exactly, they are supposed to be terse. So I think we should reject this. -- resolution: - rejected stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org

Function Defaults - avoiding unneccerary combinations of arguments at input

2015-03-25 Thread Ivan Evstegneev
Hello all , Just a little question about function's default arguments. Let's say I have this function: def my_fun(history=False, built=False, current=False, topo=None, full=False, file=None): if currnet and full: do something_1 elif current and file:

[issue2211] Cookie.Morsel interface needs update

2015-03-25 Thread Demian Brecht
Demian Brecht added the comment: Problem (pretty much) solved. Nested unordered lists are supported. I've updated the versionchanged information to use the list. -- Added file: http://bugs.python.org/file38690/http_cookies_morsel_deprecated_set_2.patch

[issue22931] cookies with square brackets in value

2015-03-25 Thread Tim Graham
Tim Graham added the comment: Will this regression be fixed in Python 2.7, 3.2, and 3.3? If not, Django may need to vendor Python's cookie class to workaround this bug to prevent users from losing sessions and/or being unable to login to Django powered sites as reported in

[issue23487] argparse: add_subparsers 'action' broken

2015-03-25 Thread paul j3
Changes by paul j3 ajipa...@gmail.com: -- assignee: - docs@python components: +Documentation nosy: +docs@python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23487 ___

[issue1191964] add non-blocking read and write methods to subprocess.Popen

2015-03-25 Thread Josiah Carlson
Josiah Carlson added the comment: I'm going to be honest; seeing None being returned from a pipe read feels *really* broken to me. When I get None returned from an IO read operation, my first instinct is there can't be anything else coming, why else would it return None? After changing

[issue22364] Improve some re error messages using regex for hints

2015-03-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22364 ___

RE: Function Defaults - avoiding unneccerary combinations of arguments at input

2015-03-25 Thread Ivan Evstegneev
Hello again ^_^, Googled a bit, and found only one, a ValueError exception, but still don't understand how it should be implemented in my case. Should my code look like this one: def my_fun(history=False, built=False, current=False, topo=None, full=False, file=None): try:

Re: Function Defaults - avoiding unneccerary combinations of arguments at input

2015-03-25 Thread Terry Reedy
On 3/25/2015 1:43 PM, Ivan Evstegneev wrote: Hello all , Just a little question about function's default arguments. Let's say I have this function: def my_fun(history=False, built=False, current=False, topo=None, full=False, file=None): if currnet and full: do

Re: Sudoku solver

2015-03-25 Thread Marko Rauhamaa
John Ladasky john_lada...@sbcglobal.net: On Wednesday, March 25, 2015 at 4:39:40 AM UTC-7, Marko Rauhamaa wrote: I post below a sudoku solver. I eagerly await neater implementations (as well as bug reports). So, it's a brute-force, recursive solver? The code is nice and short. But I bet it

Re: Supply condition in function call

2015-03-25 Thread Joel Goldstick
On Wed, Mar 25, 2015 at 1:51 PM, Manuel Graune manuel.gra...@koeln.de wrote: Joel Goldstick joel.goldst...@gmail.com writes: On Wed, Mar 25, 2015 at 1:29 PM, Manuel Graune manuel.gra...@koeln.de wrote: def test1(a, b, condition=True): for i,j in zip(a,b): c=i+j if

[issue22609] Constructors of some mapping classes don't accept `self` keyword argument

2015-03-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch for UserDict, that keep current behavior, but allows to pass keys self and dict if positional parameter dict is specified. UserDict(self=42) {'self': 42} UserDict({}, dict=42) {'dict': 42} UserDict(dict={'a': 42}) {'a': 42} --

[issue22364] Improve some re error messages using regex for hints

2015-03-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 068365acbe73 by Serhiy Storchaka in branch 'default': Issue #22364: Improved some re error messages using regex for hints. https://hg.python.org/cpython/rev/068365acbe73 -- nosy: +python-dev ___ Python

Basic Python V3 Search Tool using RE module

2015-03-25 Thread Gregg Dotoli
This basic script will help to find evidence of CryptoWall on a slave drive. Although it is just a string, more complex regex patterns can be replaced with the string. It is incredible how fast Python is and how easy it has helped in quickly assessing a pool of slave drives. I'm improving it as

[issue1191964] add non-blocking read and write methods to subprocess.Popen

2015-03-25 Thread Akira Li
Akira Li added the comment: I'm going to be honest; seeing None being returned from a pipe read feels *really* broken to me. When I get None returned from an IO read operation, my first instinct is there can't be anything else coming, why else would it return None? It is how it is done

Re: Sudoku solver

2015-03-25 Thread John Ladasky
On Wednesday, March 25, 2015 at 4:39:40 AM UTC-7, Marko Rauhamaa wrote: I post below a sudoku solver. I eagerly await neater implementations (as well as bug reports). So, it's a brute-force, recursive solver? The code is nice and short. But I bet it takes a long time to run. I and a

  1   2   >