Asking conceptual questions Many conceptual questions have already been asked and answered. According to your info it should then be possible to run tox -e py27,py36,lint and trigger the exception then. The visible difference is that s wasn't changed after we instantiated it. It is probably caused by the python 3. Unicode strings look, walk, and talk like regular strings. For example, linking to some tweet or some half-hearted blog post which links to the page is not ok; but linking to a tweet with interesting replies or to a blog post that does some extra analysis is. Communicate to others the same way you would at your workplace.
There are 2 places that concern me, one is- which calls sys. However, file fname , open fname , os. See our for more details. Whereas you have opened the file simply for writing, so maybe it needs to be: thanks! Based on the error, my reaction is to think that pickled doesn't support bytes objects in pickles. I changed mind and posted a bug on Roundup already bug 2782.
On second thought, perhaps the culprit isn't pickle here, but the stream writer. See our for more details. The fix for this one is simple, patch incoming! Refer to help topic on how to post. He's got a heart of a little child, and he keeps it in a jar on his desk. Distinguishing between tasteless and tasteful self-promotion is inherently subjective. When in doubt, message the mods and ask them to review your post.
Technically you might be able to work around it by opening the file in binary mode but that is the wrong way of doing it and might break when we finally get around to really fixing it, also won't work for unicode and string containing escape characters e. Shouldn't savetxt work on txt files? In any case, I'll try again with a different Python setup. Thankfully, turning 8-bit strings into unicode strings and vice-versa, and all the methods in between the two is forgotten in Python 3. An error like this is not intuitive. I did not check myself whats going on there yet, but this is where I would start looking. Now you will understand and change code.
I write some strings to it. Unicode strings look, walk, and talk like regular strings. Before answering that question, we'll first look at b'. Since Tox is designed to call Python 3 and Python 2 equally, it's probably in a subprocess that's the issue, not in the main tox application. Open the file in binary mode.
Why do you think that this is a bug? The only info I have is: platform win32 -- Python 3. Have a question about this project? So you have to convert it to string. The issue appears to specifically stem from. Do not suggest or help somebody do something illegal or unethical. Whenever I include the environment 'lint' it crashes. That means the file object's write method expects a character string, not a byte string. So you have to convert it to string.
The second and I think the culprit because this is almost impossible to properly debug is Here is my tox. It's the duck typing principle. After seeing the tidbit about the doc, I decided to look again. It expects a binary file, and it's going to pass a byte string when it calls the file object's write method. Questions that straddle the line between learning programming and learning other tech topics are ok: we don't expect beginners to know how exactly to categorize their question.
How do I implement them? At the moment this does not yet trigger the error see log. Other file-like objects GzipFile, ZipExtFile etc should be updated too. But I also can't open the file in binary mode because then I can't write strings to it. I did not override the test command and use pytest, because I guess these are not specific to reproduce the error. As before Thank you very much! Now to see how bytes objects relate to strings, let's first look at how to turn a string into a bytes object and vice versa. With my previous example, it is an instance of when I launch pdb it is a so it seems safer to do this instead: if isinstance self. I didn't see where it tells you that the file must be a binary-mode file.
I guess the current one, because I use devpi test and it creates a fresh virtualenv. In short, link to only your code and be specific about what you want feedback on. Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. It mentions a couple times that pickle generates a byte stream. It's the duck typing principle. Asking for code reviews is ok as long as you. Either it's related to the output capturing of pytest, or pdb++ does something similar and needs to be fixed.
It was pretty much the only hit I could find for this problem and I thought I'd put a note in case somebody runs into the same issue. Alternatively, Windows is 100% fine with forward slashes, so you can just use those, as they require no special escaping. I then modify the codes. My setup involves several different modules, not yet sure which of them causes the problem. Also, by pritting the type of self. But, passing file handle gives an error, while it works fine on python2.