[issue46628] Can't install YARL

2022-02-03 Thread Paul Koning
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

[issue46628] Can't install YARL

2022-02-03 Thread Paul Koning
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

[issue46628] Can't install YARL

2022-02-03 Thread Paul Koning
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

[issue33470] Changes from GH-1638 (GH-3575, bpo-28411) are not documented in Porting to Python 3.7

2018-05-31 Thread Paul Koning
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

[issue21750] mock_open data is visible only once for the life of the class

2015-07-22 Thread Paul Koning
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

[issue21750] mock_open data is visible only once for the life of the class

2015-07-22 Thread Paul Koning
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

[issue21750] mock_open data is visible only once for the life of the class

2015-07-21 Thread Paul Koning
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

[issue21750] mock_open data is visible only once for the life of the class

2015-07-21 Thread Paul Koning
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

[issue21750] mock_open data is visible only once for the life of the class

2014-06-13 Thread Paul Koning
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

[issue21258] Add __iter__ support for mock_open

2014-06-12 Thread Paul Koning
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

[issue21258] Add __iter__ support for mock_open

2014-06-12 Thread Paul Koning
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

[issue17309] __bytes__ doesn't work in subclass of int

2013-02-27 Thread Paul Koning
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