[issue34725] Py_GetProgramFullPath() odd behaviour in Windows

2018-10-14 Thread Mario
Mario added the comment: On 13/10/2018 17:37, Steve Dower wrote: > > Steve Dower added the comment: > > I meant why are you using an embedded application with a virtual environment? > What sort of application do you have that requires users to configure a > virtual e

[issue34725] Py_GetProgramFullPath() odd behaviour in Windows

2018-10-03 Thread Mario
Mario added the comment: Is there any agreement on what is wrong with the current code. The key in my opinion is the double purpose of sys.executable and that in Linux and Windows people have taken the two different points of view, so they are both right and wrong at the same time

[issue34725] Py_GetProgramFullPath() odd behaviour in Windows

2018-10-10 Thread Mario
Mario added the comment: On 10/10/2018 01:11, Steve Dower wrote: > > Steve Dower added the comment: > > We'll need to bring in venv specialists to check whether using it outside of > Py_Main() is valid. Or perhaps you could explain what you are actually trying > to do? &

[issue34725] Py_GetProgramFullPath() odd behaviour in Windows

2018-10-08 Thread Mario
Mario added the comment: On 08/10/2018 17:54, Steve Dower wrote: > > Steve Dower added the comment: > >> Py_SetProgramName() should be a relative or absolute path that can be used >> to set sys.executable and other values appropriately. > > Key point here is *c

[issue34725] Py_GetProgramFullPath() odd behaviour in Windows

2018-09-21 Thread Mario
Mario added the comment: On 21/09/2018 21:44, Steve Dower wrote: > > Steve Dower added the comment: > > I meant returning the full name of the process is intentional. But you're > right that overriding it should actually override it. > > I found the prior bug a

[issue34725] Py_GetProgramFullPath() odd behaviour in Windows

2018-09-18 Thread Mario
Mario added the comment: On 18/09/2018 19:24, Steve Dower wrote: > > Steve Dower added the comment: > > That executable doesn't appear to be in a virtual environment - you should be > running C:\TEMP\venv\abcd\Scripts\python.exe > > Does that resolve your pro

[issue34725] Py_GetProgramFullPath() odd behaviour in Windows

2018-09-18 Thread Mario
New submission from Mario : According to the doc Py_GetProgramFullPath() should return the full path of the program name as set by Py_SetProgramName(). https://docs.python.org/3/c-api/init.html#c.Py_GetProgramFullPath This works well in Linux, but in Windows it is always the name

[issue34725] Py_GetProgramFullPath() odd behaviour in Windows

2019-05-27 Thread Mario
Mario added the comment: Unfortunately the underlying cause of this issue has not been addressed, nor discussed. There is now a way to workaround the different behaviour in Windows and Linux and it is possible to use the new call to make virtual environment work in Windows as they already

[issue3944] faster long multiplication

2008-09-24 Thread Pernici Mario
Pernici Mario [EMAIL PROTECTED] added the comment: Yes, I think that the speed-up is due to reducing the number of shifts and masks. Changing PyLong_SHIFT to 16 would be complicated; for instance in v_iadd() carry could not be a digit of 16 bits anymore; writing code specific for 64 bit

[issue3944] faster long multiplication

2008-09-29 Thread Pernici Mario
Pernici Mario [EMAIL PROTECTED] added the comment: Mark, following your suggestions about using bigger integer types, I added code to convert Python numbers to arrays of twodigits, when a 64 bit integer type is supported, and for numbers with size larger than 20; otherwise the code

[issue3451] Asymptotically faster divmod and str(long)

2008-10-13 Thread Pernici Mario
Pernici Mario [EMAIL PROTECTED] added the comment: In this patch I added to the patch by Mark in issue 3944 the code in the previous patch, modified to release memory in case of exceptions. Benchmark for division on Athlon 64 3800+ with respect to Python3.0: (1) Python with patch 30bit.patch

[issue1225769] Proposal to implement comment rows in csv module

2010-01-27 Thread Mario Fasold
Mario Fasold fas...@googlemail.com added the comment: Comment lines are a *very* common case in scientific and statistical data. +1 for the change. -- nosy: +Mario.Fasold ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1225769

[issue3451] Asymptotically faster divmod and str(long)

2008-09-08 Thread Pernici Mario
Pernici Mario [EMAIL PROTECTED] added the comment: I have translated in C the algorithm for long division by Burnikel and Ziegler (BZ), using the Python version fast_div.py and the suggestions by Mark. Here is a benchmark for divmod(p. q), p = 7**np, q = 5**nq digits = q_digits = p_digits/2

[issue7440] distutils shows incorrect Python version in MSI installers

2009-12-04 Thread Mario Vilas
New submission from Mario Vilas mvi...@gmail.com: I just hit this silly bug in distutils, should be quite easy to fix. When building MSI installers for a target_version other than the current Python version, the target directory selection dialog shows a wrong message. For example, here

[issue7440] distutils shows incorrect Python version in MSI installers

2009-12-04 Thread Mario Vilas
Mario Vilas mvi...@gmail.com added the comment: My proposed patch is to change line 506 of bdist_msi.py from this: version = sys.version[:3]+ to this: version = self.target_version[:3]+ which is what I did to work around the problem

[issue11875] OrderedDict.__reduce__ not threadsafe

2011-04-19 Thread Mario Juric
New submission from Mario Juric mju...@ias.edu: The implementation of OrderedDict.__reduce__() in Python 2.7.1 is not thread safe because of the following four lines: tmp = self.__map, self.__root del self.__map, self.__root inst_dict = vars(self).copy() self

[issue11875] OrderedDict.__reduce__ not threadsafe

2011-04-19 Thread Mario Juric
Mario Juric mju...@ias.edu added the comment: Hi Raymond, Excellent! Many thanks for such a quick fix, this has been bugging us for months! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11875

[issue14529] distutils's build_msi command ignores the data_files argument

2012-04-08 Thread Mario Vilas
New submission from Mario Vilas mvi...@gmail.com: When creating an MSI installer on Python 2.7 (Windows, both in 32 and 64 bits) the data_files argument of the setup function is completely ignored. This results in broken installations. -- assignee: eric.araujo components: Distutils

[issue14530] distutils's build_wininst command fails to correctly interpret the data_files argument

2012-04-08 Thread Mario Vilas
New submission from Mario Vilas mvi...@gmail.com: I tried the following: setup( data_files = [(sys.prefix_exec, os.path.join('Win32', 'BeaEngine.dll'))] # (... rest of the setup call here...) ) This works perfectly when running the python setup.py install. But when generating

[issue18005] faster modular exponentiation in some cases

2013-05-18 Thread Pernici Mario
New submission from Pernici Mario: A trivial optimization can be made in ``pow(a, b, c)`` if ``b`` is even and ``c - a a`` ``` In [1]: c = (1 100) + 1 In [2]: a = c - 1234567 In [3]: b = 2 In [4]: %timeit pow(a, b, c) 1 loops, best of 3: 3.03 s per loop In [5]: %timeit pow(c - a if c

[issue4258] Use 30-bit digits instead of 15-bit digits for Python integers.

2009-02-19 Thread Pernici Mario
Pernici Mario pern...@users.sourceforge.net added the comment: The attached patch uses mul1 in long_mul in the version patched with 30bit_longdigit13+optimizations.patch Comparison between these two patches on hp pavilion Q8200 2.33GHz pybench patch new patch

[issue3451] Asymptotically faster divmod and str(long)

2009-03-30 Thread Pernici Mario
Pernici Mario pern...@users.sourceforge.net added the comment: In this patch there is an implementation of the algorithm to convert numbers in strings by recursively splitting the number in half, adapted from Fredrik's div.py -- Added file: http://bugs.python.org/file13496

[issue3451] Asymptotically faster divmod and str(long)

2009-03-30 Thread Pernici Mario
Pernici Mario pern...@users.sourceforge.net added the comment: In this second patch to the above patch it is added the recursive division algorithm by Burnikel and Ziegler (BZ) from longobject2.diff, unmodified, to see the effect of the subquadratic algorithm; there is still a lot of work

[issue2889] curses for windows (alternative patch)

2015-03-11 Thread Mario Figueiredo
Mario Figueiredo added the comment: This patch is a huge improvement over the current situation, which is we don't have a cross-platform curses implementation in the standard library. The alternatives listed by Mark aren't sufficient. For the two reasons given below: - The implementation

[issue25542] tuple unpacking on assignment should be lazy for unpacked generators

2015-11-03 Thread Mario Wenzel
New submission from Mario Wenzel: if I have an assignment a = then a is the generator. But if I do any kind of unpacking *a, = # a list of all items a, *aa = # first item in a, list of rest in as If the right-hand side is a generator expression, I would expect that a, *aa unpacks

[issue25542] tuple unpacking on assignment should be lazy for unpacked generators

2015-11-03 Thread Mario Wenzel
Mario Wenzel added the comment: You are right. I didn't even know head, *middle, end = worked. Thanks -- resolution: -> rejected status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue27658] python 3.5.2 built from source fails to install completely on Mac OS X 10.11.6. Crashes subsequently.

2016-07-30 Thread Mario Grgic
New submission from Mario Grgic: I am on Mac OS X 10.11.6 trying to build and install Python 3.5.2 from source. I only have system Python 2.7.10 , and no other instances of Python 3.x. I configure the build as follows: ./configure --prefix=/Volumes/ramdisk/python3.5.2 The code is built

[issue27658] python 3.5.2 built from source fails to install completely on Mac OS X 10.11.6. Crashes subsequently.

2016-07-30 Thread Mario Grgic
Mario Grgic added the comment: It looks like it is picking up libcrypto.1.0.0.dylib from /usr/local/lib which I installed there as dependency for other binaries. Is there a minimal version of libcrypto that Python 3.5.2 needs? -- ___ Python

[issue27658] python 3.5.2 built from source fails to install completely on Mac OS X 10.11.6. Crashes subsequently.

2016-07-30 Thread Mario Grgic
Mario Grgic added the comment: OK, after installing OpenSSL in /usr/local/ssl and even after copying libssl.pc, libcrypt.pc and openssl.pc over to /usr/local/lib/pkgconfig (which is where my pkg-config is looking or *.pc files) the configure script is still not finding the correct libcrypto

[issue27820] Possible bug in smtplib when initial_response_ok=False

2016-08-22 Thread Mario Colombo
Mario Colombo added the comment: Yes, this (or something similar) totally bit me, when for another unrelated reason 'AUTH PLAIN' authentication failed: https://gist.github.com/macolo/bf2811c14d985d013dda0741bfd339e0 Python then tries auth_login, but doesn't send 'AUTH LOGIN' to the mail

[issue30189] SSL match_hostname does not accept IP Address

2017-04-27 Thread Mario Viapiano
New submission from Mario Viapiano: I need this patch to be available in python 2.7.13 https://bugs.python.org/issue23239 -- components: Extension Modules messages: 292468 nosy: emeve89 priority: normal severity: normal status: open title: SSL match_hostname does not accept IP Address

[issue30541] Add restricted mocks to the python unittest mocking framework

2017-06-21 Thread Mario Corchero
Mario Corchero added the comment: Whilst I agree that using spec can be used for a similar purpose and I did not know about being able to do nested definitions via the arguments (the **{"method1.return_value": 1}, really cool!) I find the idea of allowing users to halt the mock

[issue30541] Add restricted mocks to the python unittest mocking framework

2017-06-02 Thread Mario Corchero
Changes by Mario Corchero <marioc...@gmail.com>: -- pull_requests: +2003 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30541> ___

[issue30541] Add restricted mocks to the python unittest mocking framework

2017-06-01 Thread Mario Corchero
Mario Corchero added the comment: Sample implementation using the new class: https://github.com/mariocj89/cpython/commit/2f13963159e239de041cd68273b9fc4a2aa778cd Sample implementation using the new function to seal existing mocks: https://github.com/mariocj89/cpython/commit

[issue30541] Add restricted mocks to the python unittest mocking framework

2017-06-01 Thread Mario Corchero
New submission from Mario Corchero: Define a way to disable the automatic generation of submocks when accessing an attribute of a mock which is not set. Rationale: Inspired by GMock RestrictedMock, it aims to allow the developer to declare a narrow interface to the mock that defines what

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-17 Thread Mario Corchero
Mario Corchero <marioc...@gmail.com> added the comment: Yep, http://man7.org/linux/man-pages/man3/strptime.3.html does support it even if it might look asymetrical. Example: struct tm tm; char buf[255]; memset(, 0, sizeof(struct tm)); strptim

[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2017-10-17 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- nosy: +mariocj89 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue24954> ___ _

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-16 Thread Mario Corchero
New submission from Mario Corchero <marioc...@gmail.com>: Currently, datetime.strptime does not support parsing utc offsets that include a colon. "+" is parsed without issues whilst it fails with "+00:00". "+NN:NN" is not only ISO8601 valid but

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-16 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- keywords: +patch pull_requests: +3989 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue31454] Include "import as" in tutorial

2017-10-18 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- nosy: +mariocj89 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31454> ___ _

[issue31454] Include "import as" in tutorial

2017-10-18 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- keywords: +patch pull_requests: +4012 stage: needs patch -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2017-10-18 Thread Mario Corchero
Mario Corchero <marioc...@gmail.com> added the comment: Wrote https://bugs.python.org/issue31800 without realising this issue was open (Thanks for bringing it up Martin Panter). issue31800 basically just adds the ability to parse NN:NN to the already existing python isoformat function w

[issue32010] Multiple get "itemgetter"

2017-11-12 Thread Mario Corchero
New submission from Mario Corchero <marioc...@gmail.com>: At the moment we can get an operator that performs multiple "gets" in object attributes. Example: >>> getter = operator.attrgetter("child1.child2") >>> o = mock.Mock() >>> getter(

[issue30699] Misleading class names in datetime.tzinfo usage examples

2017-11-05 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- nosy: +mariocj89 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue30699> ___ _

[issue30548] typo in documentation for create_autospec

2017-11-05 Thread Mario Corchero
Mario Corchero <marioc...@gmail.com> added the comment: I've always understood instance as a way to say "I am passing this class but I want to force the autospec on the instance" For example, given ``` class X: def __init__(self): raise

[issue30699] Misleading class names in datetime.tzinfo usage examples

2017-11-05 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- keywords: +patch pull_requests: +4253 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32206] Run modules with pdb

2017-12-07 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- keywords: +patch pull_requests: +4654 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32267] strptime misparses offsets with microsecond format

2017-12-10 Thread Mario Corchero
New submission from Mario Corchero <marioc...@gmail.com>: At the moment strptime misparses all microsecond specifications that do not have exactly 6 digits as it is just converted into an int and considered microsecond. This bug was introduced with the implementation in bpo-31800 E

[issue32267] strptime misparses offsets with microsecond format

2017-12-10 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- keywords: +patch pull_requests: +4682 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32206] Run modules with pdb

2017-12-03 Thread Mario Corchero
New submission from Mario Corchero <marioc...@gmail.com>: Since PEP 338 we can run python modules as a script via `python -m module_name` but there is no way to run pdb on those (AFAIK). The proposal is to add a new argument "-m" to the pdb module to allow users to run `

[issue33541] Remove private and apparently unused __pad function

2018-05-16 Thread Mario Corchero
New submission from Mario Corchero <marioc...@gmail.com>: When checking on ways to improve coverage of datetime related functions I found this function that seems not to be used anyware. It is private and mangled, should be safe to remove. Creating the issue as requested in the PR:

[issue33541] Remove private and apparently unused __pad function

2018-05-16 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- keywords: +patch pull_requests: +6579 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-19 Thread Mario Corchero
Mario Corchero <marioc...@gmail.com> added the comment: As a note Seems support for the ":" was added in 2015 for glibc: http://code.metager.de/source/xref/gnu/glibc/time/strptime_l.c#765 Commit e952e1df Before that, it basically just ign

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-19 Thread Mario Corchero
Mario Corchero <marioc...@gmail.com> added the comment: I have a patch to add 'Z' support as well if we are interested in making it the same as it glibc does. (as it supports it as well) -- ___ Python tracker <rep...@bugs.python.or

[issue32206] Run modules with pdb

2018-01-06 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- pull_requests: +4978 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32206> ___

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2018-01-06 Thread Mario Corchero
Mario Corchero <marioc...@gmail.com> added the comment: pdb and cProfile are covered. If no one is working on it, do you want me try to put through a patch for "profile" and "trace"? Should I create a separate issue if so? >From Issue 17473 it will leav

[issue32512] Add an option to profile to run library module as a script

2018-01-07 Thread Mario Corchero
New submission from Mario Corchero <marioc...@gmail.com>: Add an option to profile to be able to do `python3 -m profile -m my.module.name` to be able to profile the module the same way cProfile allows since issue 21862 -- components: Library (Lib) messages: 309627 nosy: mar

[issue32512] Add an option to profile to run library module as a script

2018-01-07 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- keywords: +patch pull_requests: +4993 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2018-01-07 Thread Mario Corchero
Mario Corchero <marioc...@gmail.com> added the comment: I've created an issue + PR for profile which basically ports the change in cProfile: issue32512 I am not able to add it as a dependency on this one (rights issue probably). -- ___

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2018-01-07 Thread Mario Corchero
Mario Corchero <marioc...@gmail.com> added the comment: Just finished a draft on the one for trace: issue32515 -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.pytho

[issue32515] Add an option to trace to run module as a script

2018-01-07 Thread Mario Corchero
New submission from Mario Corchero <marioc...@gmail.com>: Add an option to trace to be able to do `python3 -m trace -t --module my.module.name` to be able to trace a runnable module the same way we can do with scripts. As we want trace to not include the lines in runpy I am

[issue32515] Add an option to trace to run module as a script

2018-01-07 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- keywords: +patch pull_requests: +4995 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32512] Add an option to profile to run library module as a script

2018-01-07 Thread Mario Corchero
Mario Corchero <marioc...@gmail.com> added the comment: Related issue for improved executable module support for standard library modules that run other scripts: https://bugs.python.org/issue9325 -- ___ Python tracker <rep...@bugs.python.or

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2018-01-10 Thread Mario Corchero
Mario Corchero <marioc...@gmail.com> added the comment: Thanks Nick. I've sent patches for all of them but `dis`. `dis` does not "run" the code. Adding the -m option is basically identical to just running it on the __main__.py if the module is runnable or on the __init__ if it

[issue32206] Run modules with pdb

2018-01-27 Thread Mario Corchero
Mario Corchero <marioc...@gmail.com> added the comment: Hi Jason, thanks a lot! I’ll have a look to the bug you reported on Monday. Out for holidays atm ^^ -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32691] "pdb -m " sets __main__.__package__ incorrectly

2018-02-01 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- keywords: +patch pull_requests: +5302 stage: test needed -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32206] Run modules with pdb

2018-02-01 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- pull_requests: -5301 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32206> ___

[issue32691] "pdb -m " sets __main__.__package__ incorrectly

2018-02-01 Thread Mario Corchero
Mario Corchero <marioc...@gmail.com> added the comment: OK, just managed to reproduce it. This appears only when you run a python script as a module. Running a module with __main__ does not show the issue. Will get a patch ready -- ___

[issue32691] "pdb -m " sets __main__.__package__ incorrectly

2018-02-01 Thread Mario Corchero
Mario Corchero <marioc...@gmail.com> added the comment: Sent a PR for the fix. I'll update PRs for trace. profile does not need it Thanks a lot for bringing it up Jason! -- ___ Python tracker <rep...@bugs.python.org> <https://

[issue32206] Run modules with pdb

2018-02-01 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- pull_requests: +5301 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32206> ___

[issue32206] Run modules with pdb

2018-02-01 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- pull_requests: +5321, 5322 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32206] Run modules with pdb

2018-02-01 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- pull_requests: +5321 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32206> ___

[issue32821] Add snippet on how to configure a "split" stream for console

2018-02-11 Thread Mario Corchero
New submission from Mario Corchero <marioc...@gmail.com>: As discussed in python-ideas, it would be good to have a recipe on how to configure the logging stack to be able to log ``ERROR`` and above to stderr and ``INFO`` and below to stdout. It was proposed to add it into the cookbook

[issue32821] Add snippet on how to configure a "split" stream for console

2018-02-11 Thread Mario Corchero
Change by Mario Corchero <marioc...@gmail.com>: -- keywords: +patch pull_requests: +5433 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue35082] Mock.__dir__ lists deleted attributes

2018-10-27 Thread Mario Corchero
New submission from Mario Corchero : Calling dir on unittest.mock.Mock will return deleted attributes. This is a result of the way del is implemented in Mock, which just sets a sentinel in the child mocks, so an AttributeError is raised if the attribute is later accessed. We can just check

[issue35082] Mock.__dir__ lists deleted attributes

2018-10-27 Thread Mario Corchero
Change by Mario Corchero : -- keywords: +patch pull_requests: +9476 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35082> ___ ___ Py

[issue33236] MagicMock().__iter__.return_value is different from MagicMock().__iter__()

2018-10-27 Thread Mario Corchero
Mario Corchero added the comment: iter is initialized by using side_effects, not return_value. The statement "According to the documentation .return_value should be identical to the object returned when calling the mock" works only when it return_value has been used to define the

[issue32512] Add an option to profile to run library module as a script

2018-11-05 Thread Mario Corchero
Change by Mario Corchero : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue35226] mock.call equality surprisingly broken

2018-11-13 Thread Mario Corchero
Mario Corchero added the comment: If this is to be done we should not change those tests, I am sure there is code validating calls relying on its "tupleness". Example: ``` >>> import unittest.mock >>> m = unittest.mock.Mock() >>> m(1) >>>

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2018-12-15 Thread Mario Corchero
Mario Corchero added the comment: Makes sense! I'd not align them though but that might be my view as I generally don't like aligning text like that. Also if you feel that the exceptions read "weird" with the first sentence is empty, an option might be to say the calls don't matc

[issue24928] mock.patch.dict spoils order of items in collections.OrderedDict

2018-12-21 Thread Mario Corchero
Mario Corchero added the comment: I would suggest applying the fix with the latest version in mind to keep the codebase clean. If you want to backport it to previous versions of Python you can do it manually through a PR targetting the right branch. I think the process is to set up a label

[issue3533] mac 10.4 buld of 3.0 --with-pydebug fails no __eprintf

2018-12-05 Thread Mario Corchero
Change by Mario Corchero : -- pull_requests: +10215 ___ Python tracker <https://bugs.python.org/issue3533> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35330] When using mock to wrap an existing object, side_effect requires return_value

2018-12-05 Thread Mario Corchero
Mario Corchero added the comment: I'll get ready a PR with a good set of tests and the fix for the original issue. This is quite an interesting bug :) -- ___ Python tracker <https://bugs.python.org/issue35

[issue17185] unittest mock create_autospec doesn't correctly replace mocksignature

2018-12-07 Thread Mario Corchero
Mario Corchero added the comment: Agree that it sounds reasonable to just set `__signature__` to tell `inspect` where to look at (thanks PEP 362 :P). Not an expert here though. For the partials bug, I'll add Pablo as we were speaking today about something similar :) but that might

[issue35330] When using mock to wrap an existing object, side_effect requires return_value

2018-12-06 Thread Mario Corchero
Change by Mario Corchero : -- keywords: +patch pull_requests: +10234 stage: test needed -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35330] When using mock to wrap an existing object, side_effect requires return_value

2018-11-28 Thread Mario Corchero
Mario Corchero added the comment: I can indeed reproduce the issue. The problem seems to be here: https://github.com/python/cpython/blob/54ba556c6c7d8fd5504dc142c2e773890c55a774/Lib/unittest/mock.py#L1041 The simplified current logic in that code is: - call side_effect, save the return value

[issue32299] unittest.mock.patch.dict.__enter__ should return the dict

2018-12-10 Thread Mario Corchero
Change by Mario Corchero : -- pull_requests: +10296 ___ Python tracker <https://bugs.python.org/issue32299> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36518] Avoid conflicts when pass arbitrary keyword arguments to Python function

2019-04-03 Thread Mario Corchero
Change by Mario Corchero : -- nosy: +mariocj89 ___ Python tracker <https://bugs.python.org/issue36518> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2019-03-02 Thread Mario Corchero
Mario Corchero added the comment: Quite a tricky bug! Indeed @xtreak the `_call_matcher` is using the `__init__` signature. I think this is a bug introduced in https://bugs.python.org/issue17015. There is a mix of the fact that spec in Mock also can accept classes (not instances) whilst

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-02-23 Thread Mario Corchero
Mario Corchero added the comment: Interesting, `patch` does resolve it when the patched function is called (see https://github.com/python/cpython/blob/175421b58cc97a2555e474f479f30a6c5d2250b0/Lib/unittest/mock.py#L1269) vs patch.dict that resolves it at the time the patcher is created - when

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-02-23 Thread Mario Corchero
Mario Corchero added the comment: Great, all yours :) I'll be happy to review. -- ___ Python tracker <https://bugs.python.org/issue35512> ___ ___ Python-bug

[issue17013] Allow waiting on a mock

2019-04-13 Thread Mario Corchero
Mario Corchero added the comment: I think this is REALLY interesting!, there are many situations where this has been useful, it would greatly improve multithreading testing in Python. Q? I see you inherit from Mock, should it inherit from MagicMock? I'd say send the PR and the discussion can

[issue17013] Allow waiting on a mock

2019-04-13 Thread Mario Corchero
Mario Corchero added the comment: Kooning great! I would Add a test for the following (I think both fails with the proposed impl): - The mock is called BEFORE calling wait_until_called_with - I call the mock with arguments and then I call wait for call without arguments. - using keyword

[issue29143] Logger should ignore propagate property for disabled handlers.

2019-05-27 Thread Mario Corchero
Mario Corchero added the comment: Note that "handlers" cannot be disabled. This applies only to loggers. Also, the following code shows that disabling the logger does indeed prevents all logs in emitted by that logger from appearing: ``` import logging pare

[issue37104] logging.Logger.disabled is not documented

2019-05-31 Thread Mario Corchero
Mario Corchero added the comment: Thanks! I was wondering about it but saw no comment about it, issue or anything in the history. At least we have now this issue :). Would you like that I move this to `_disabled` and have a setter for `disabled` that emits a deprecation warning so we can

[issue29143] Logger should ignore propagate property for disabled handlers.

2019-05-30 Thread Mario Corchero
Mario Corchero added the comment: Closing as unable to reproduce. Please comment if you can reproduce the issue and we can have a further look. -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/i

[issue37104] logging.Logger.disabled is not documented

2019-05-30 Thread Mario Corchero
New submission from Mario Corchero : Just realised the "disabled" attribute of the Logger class is not documented in https://docs.python.org/3/library/logging.html#logging.Logger. Any reason to not have it documented? I'll send a PR otherwise. This comes as I was trying to point t

[issue37104] logging.Logger.disabled is not documented

2019-05-30 Thread Mario Corchero
Change by Mario Corchero : -- keywords: +patch pull_requests: +13575 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13687 ___ Python tracker <https://bugs.python.org/issu

[issue37104] logging.Logger.disabled is not documented

2019-05-31 Thread Mario Corchero
Mario Corchero added the comment: Note that even if not in the standard library I've seen this attributed used and documented quite often. Example: https://docs.python-guide.org/writing/logging/#or-print I would really suggest making it private as mentioned before to make sure this does

[issue37117] Simplify customization of the logging time through datefmt

2019-05-31 Thread Mario Corchero
New submission from Mario Corchero : Users that want to provide a custom template for the timestamp part of logging cannot customize the milliseconds part of asctime. They can use the msecs attribute of the Logger but that effectively requires to break the formatting in two parts. Note

  1   2   >