Paul Koning added the comment:
Thanks, I'll pass the word to the yarl and aiohttp team (both have this issue).
--
___
Python tracker
<https://bugs.python.org/is
Paul Koning added the comment:
The only dependency mentioned by the yarl documentation is multidict and
installing that makes no difference. I see I can tell yarl to build a
pure-python version to avoid compiling stuff. If I do that it installs. But
what I actually wanted to do is
New submission from Paul Koning :
Trying to install "aiohttp" with pip I get a compile error installing "yarl".
I get the same error when I install just that module. But it installs fine on
3.10. This is on an Apple M1 (ARM64) machine.
--
components: macOS
file
Paul Koning added the comment:
FYI, I'm the one who created this problem back in 2012. I just submitted a GDB
patch for this, using PyImport_AppendInittab to define the built-in module at
startup. I'm not sure how I missed this originally; perhaps the documentation
was not as
Paul Koning added the comment:
Section 26.7.7 of the library manual describes mock_open with the words:
A helper function to create a mock to replace the use of open. It works for
open called directly or used as a context manager.
which implies that it works just like open. Given that it
Paul Koning added the comment:
I suppose. And it certainly is much better than the original behavior. But if
this is the approach chosen, it should be clearly called out in the
documentation, because the current wording suggests the 1.1.4 behavior, not the
one you recommended
Paul Koning added the comment:
So if I understand right, it seems to me the 3.5/mock 1.1.4 behavior is
correct. mock_open(read_data="f") acts like a file that contains f, and m()
acts like an open() of that file. So if I call open once, I should read the f,
then EOF. If I open t
Paul Koning added the comment:
Sure, you can use a vfs. That's true for a lot of mock functions; the benefit
of mock, including mock_open, is that it provides an easier and better packaged
way. The behavior expected is "be like a file". So in that last example, if
you open i
New submission from Paul Koning:
The read_data iterator that supplies bits of read data when asked from
unittest.mock.mock_open is a class attribute. The result is that, if you
instantiate the class multiple times, that iterator is shared. This isn't
documented and it seems counterintu
Paul Koning added the comment:
This is the corresponding patch to the test suite.
--
Added file: http://bugs.python.org/file35598/testwith.diff
___
Python tracker
<http://bugs.python.org/issue21
Paul Koning added the comment:
I created a fix for this. This also fixes a second issue in mock_open, which
is that readline() raises StopIteration at EOF rather than returning empty
strings. See attached diff.
(Is there a better procedure for submitting fixes?)
--
nosy: +pkoning
New submission from Paul Koning:
The __bytes__ special method has no effect in a subclass of "int" because the
bytes() builtin checks for int or int subclass before it gets around to looking
for that special method. The attached example shows it.
--
components: Interpreter
12 matches
Mail list logo