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
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 of the
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
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
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
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
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
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
Mario Corchero added the comment:
Great! I'll put something together then. If you have any preference about the
implementation or any pointer on the way you think should be done, please let
me know.
--
___
Python tracker
<https://bugs.py
Change by Mario Corchero :
--
keywords: +patch
pull_requests: +28943
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30756
___
Python tracker
<https://bugs.python.org/issu
New submission from Mario Juric :
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.__map, self
Mario Juric added the comment:
Hi Raymond,
Excellent! Many thanks for such a quick fix, this has been bugging us for
months!
--
___
Python tracker
<http://bugs.python.org/issue11
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_di
New submission from Pernici Mario <[EMAIL PROTECTED]>:
In this patch x_mul(a, b) uses fewer bit operations for a != b,
asymptotically half of them.
On the three computers I tried the speed-up is around 5% for size=4
and it increases up to 45-60% just below the Karatsuba cutoff,
then it dec
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
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
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
Mario Fasold added the comment:
Comment lines are a *very* common case in scientific and statistical data. +1
for the change.
--
nosy: +Mario.Fasold
___
Python tracker
<http://bugs.python.org/issue1225
Mario Corchero added the comment:
Spoke offline with @xtreak, I'll be sending a PR for this to take over the
existing one.
@lisroach proposed a new name, EventMock to differentiate it from any awaitable
async notation.
@michael.foord suggested using `mock_timeout` as the arg
Change by Mario Corchero :
--
pull_requests: +15715
pull_request: https://github.com/python/cpython/pull/16094
___
Python tracker
<https://bugs.python.org/issue17
Mario Corchero added the comment:
This might be painful in certain scenarios, like when using wraps on functions
that modify the arguments:
```
def func(d):
return d.pop("key")
>>> def func(d):
... return d.pop("key")
...
>>> m
Mario Corchero added the comment:
Thanks! We can look at adding a copying mock if we see people needing it, but
yeah, adding copy by default would be quite complex if we don't want to break
existing users.
--
stage: -> resolved
status: open -
Mario Corchero added the comment:
Vinay would you consider a patch for logging where dictConfig allows taking
objects directly in addition to the reference id?
That would allow the following:
```
def noErrorLogs(param):
return 1 if param.levelno < 40 else 0
logconfig_d
Mario Corchero added the comment:
The reason why it seems that "no arguments are beeing passed" is because the
exception is not being raised by you, but by mock itself when the exception is
trying to be created. When an exception type is passed as side_effect, the mock
modules r
Mario Corchero added the comment:
Makes total sense, I think we should get this for 3.9.
Not sure I'll backport this, even if a bugfix it might cause unexpected changes
(Though I'd be OK with it, given that calling stop twice causes no issue).
I'm happy to push a PR with the
Change by Mario Corchero :
--
pull_requests: +17075
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/17606
___
Python tracker
<https://bugs.python.org/issu
Mario Corchero added the comment:
@cjw296 or @michael.foord might know why the attribute was exposed as plain
"parent". It was added more than 8 years ago and I am unnable to follow the git
commit history.
They should then decide whether this is intenteded to be used by the users
Mario Corchero added the comment:
If you refer to https://bugs.python.org/issue35357, this issue refers to
`parent` at the time of creation of the mock. In the init it is still
referenced as "parent".
The question is whether we want to also mangle "parent" in the __ini
Mario Corchero added the comment:
> My suggestion would be to add `parent` to the docs @xtreak links to as a way
> to resolve this issue.
+1, we should probably add it on the docs of the constructor here
https://docs.python.org/3/library/unittest.mock.html#unittest.mock.Mock as it
i
Mario Corchero added the comment:
Having not looked deeply at it but with the reproducer, running a quick bisect,
it points to this commit:
https://github.com/python/cpython/commit/77b3b7701a34ecf6316469e05b79bb91de2addfa
I'll try having a look later at the day if I can manage to free
Mario Corchero added the comment:
For the record, I have no strong preference over either implementation.
@voidspace preferred offline the new mock class, but sadly the rationale is
lost in the physical word.
--
___
Python tracker
<ht
New submission from Mario Corchero :
Following the conversations in https://bugs.python.org/issue33944, wanted to
discuss the support for a __sitecustomize__ folder that will hold python
scripts to be executed at startup. Similar to `sitecustomize.py` but allowing
different stakeholders of a
Change by Mario Corchero :
--
type: -> enhancement
___
Python tracker
<https://bugs.python.org/issue42654>
___
___
Python-bugs-list mailing list
Unsubscrib
Mario Corchero added the comment:
> Shouldn't this be discussed on Python-Ideas? I'm pretty sure this is a big
> enough change that it will need a PEP.
Indeed, I wanted to see if there was interest in the feature. That is probably
a better place to start.
> If you need
Mario Corchero added the comment:
Thread open in Python ideas:
https://discuss.python.org/t/add-folder-for-python-customizations-sitecustomize/6190/5
--
___
Python tracker
<https://bugs.python.org/issue42
Mario Corchero added the comment:
Right, I believe this is indeed broken.
This code:
```
class A:
def m(self, a=None): pass
from unittest import mock
with mock.patch.object(A, "m", autospec=True):
A.m.side_effect = print
A().m(1)
```
prints: <__main__.A object at 0
Mario Gonzalez added the comment:
hey u, send mi a mail, u need my help
and i need u
mario the last one
mario.cro...@gmail.com
--
nosy: +Mario Gonzalez
___
Python tracker
<https://bugs.python.org/issue896
Mario Corchero added the comment:
Oh, well spotted. We could add some guards around the code in mock to still
work when key stdlib functionality is mocked out, but this might make the mock
code quite messy. Specially as we will have to make sure that not only the
function we call are safe
New submission from Mario Idival :
After new version 3.9, the util module from importlib does not exists anymore
>>> import importlib
>>> importlib.util.find_spec('enum')
Traceback (most recent call last):
File "", line 1, in
AttributeError: mod
Change by Mario Idival :
--
type: -> crash
___
Python tracker
<https://bugs.python.org/issue41958>
___
___
Python-bugs-list mailing list
Unsubscrib
New submission from Mario Corchero :
When working in a C extension from a non-python created thread which calls
PyGILState_Ensure as it later calls a Python callback on user code, I wished
there was a way to set the trace function similar to what a native Python
thread would do.
We could
Change by Mario Corchero :
--
keywords: +patch
pull_requests: +22041
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/23125
___
Python tracker
<https://bugs.python.org/issu
New submission from Mario Corchero :
The sys module contains __excepthook__ to recover sys.excepthook if necessary.
The same is not present in the threading module, even if threading.excepthook
is exposed.
--
components: Library (Lib)
messages: 380651
nosy: mariocj89, vstinner
Change by Mario Corchero :
--
keywords: +patch
pull_requests: +22116
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/23218
___
Python tracker
<https://bugs.python.org/issu
Mario Corchero added the comment:
> I found one interesting usage of sys.__excepthook__ in
> code.InteractiveInterpreter:
That is exactly what I wished this was there for hehe. We are installing a
custom version of excepthook and wanted to check if the user had chan
New submission from Mario Vilas :
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
messages: 157799
New submission from Mario Vilas :
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
ge
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
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
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 po
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
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
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
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 that
Mario Corchero added the comment:
AFAIK, the converter attribute is only to "be set" with a function of such
signature. It is not documented that it can be used and it is only used on the
format time function.
The only situation where this might break someone is if they in
Mario Corchero added the comment:
> What do you mean by "it is not documented"? It is documented here:
As it says:
"This function uses a user-configurable function to convert the creation time
to a tuple. By default, time.localtime() is used; to change this for a
pa
Change by Mario Corchero :
--
nosy: +mariocj89
___
Python tracker
<https://bugs.python.org/issue37251>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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/is
Change by Mario Corchero :
--
pull_requests: +10215
___
Python tracker
<https://bugs.python.org/issue3533>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Mario Corchero :
--
keywords: +patch
pull_requests: +10234
stage: test needed -> patch review
___
Python tracker
<https://bugs.python.org/issu
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 mig
Change by Mario Corchero :
--
pull_requests: +10296
___
Python tracker
<https://bugs.python.org/issue32299>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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 the
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
Changes by Mario Corchero :
--
pull_requests: +2003
___
Python tracker
<http://bugs.python.org/issue30541>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
Mario Corchero added the comment:
Great, all yours :) I'll be happy to review.
--
___
Python tracker
<https://bugs.python.org/issue35512>
___
___
Pytho
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
Change by Mario Corchero :
--
nosy: +mariocj89
___
Python tracker
<https://bugs.python.org/issue36518>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 discussio
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
New submission from Mario Corchero :
There are multiple places in the standard library where the code captures an
exception and reraises it later (outside of the original except).
This is known to cause a cycle as saving the exception has a traceback that
eventually points back to the
Change by Mario Corchero :
--
keywords: +patch
pull_requests: +13048
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36820>
___
___
Py
Mario Corchero added the comment:
Agree, for the general case I think it makes sense that this is fixed in pyside.
Hijacking __signature__ python-wide sounds like it can cause other issues, if
they need such a hack I would suggest finding a way (in pyside) to allow for
mock to work.
I
Mario Corchero 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
<https://bugs.python.org/issue32
Mario Corchero 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
--
___
Python tracker
<ht
Change by Mario Corchero :
--
pull_requests: +5301
___
Python tracker
<https://bugs.python.org/issue32206>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Mario Corchero :
--
keywords: +patch
pull_requests: +5302
stage: test needed -> patch review
___
Python tracker
<https://bugs.python.org/issu
Mario Corchero 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
<https://bugs.python.org/is
Change by Mario Corchero :
--
pull_requests: -5301
___
Python tracker
<https://bugs.python.org/issue32206>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Mario Corchero :
--
pull_requests: +5321
___
Python tracker
<https://bugs.python.org/issue32206>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Mario Corchero :
--
pull_requests: +5321, 5322
___
Python tracker
<https://bugs.python.org/issue32206>
___
___
Python-bugs-list mailing list
Unsub
New submission from Mario Corchero :
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 rather than on the standard
Change by Mario Corchero :
--
keywords: +patch
pull_requests: +5433
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32821>
___
___
Py
New submission from Mario Corchero :
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 also the way the offset is pre
Change by Mario Corchero :
--
keywords: +patch
pull_requests: +3989
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31800>
___
___
Py
Mario Corchero 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(&tm, 0, sizeof(struct tm));
strptime("+00:00&qu
Change by Mario Corchero :
--
nosy: +mariocj89
___
Python tracker
<https://bugs.python.org/issue24954>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mario Corchero 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 when %z is specified.
Rather
Change by Mario Corchero :
--
nosy: +mariocj89
___
Python tracker
<https://bugs.python.org/issue31454>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Mario Corchero :
--
keywords: +patch
pull_requests: +4012
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Mario Corchero 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 ignores t
Mario Corchero 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
<https://bugs.python.o
Mario Corchero 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
```
You can do `unittest.mock.create_autospec(X
Change by Mario Corchero :
--
keywords: +patch
pull_requests: +4253
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue30699>
___
___
Py
1 - 100 of 138 matches
Mail list logo