New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removal of basestring type #45599
Comments
The patch removes the basestring type from Python 3.0. PyString and |
Thanks, evaluating! |
I see 10 failing tests:
|
test_ctypes: works for me |
On 10/10/07, Christian Heimes <report@bugs.python.org> wrote:
Did you svn up, make clean and rebuild?
Which test is failing?
Yes, __file__ always has that type. Fixing it is messy because it
But it passes for me.
Hm. It passes for me.
Thanks for looking into these!! |
Guido van Rossum wrote:
The ctypes package didn't change since my last rebuild an hour ago. I'm
test_decoded_generator()
The generator tries to print a str8 to a text file.
I'm already working on it. Can I introduce a new function
I'm going to look into the issue later. |
On 10/10/07, Christian Heimes <report@bugs.python.org> wrote:
Odd. I'll investigate when I have more time.
Thought so. I have a tentative fix that I want approved by Barry --- Lib/email/generator.py (revision 58412)
+++ Lib/email/generator.py (working copy)
@@ -288,7 +288,7 @@
for part in msg.walk():
maintype = part.get_content_maintype()
if maintype == 'text':
- print(part.get_payload(decode=True), file=self)
+ print(part.get_payload(decode=False), file=self)
elif maintype == 'multipart':
# Just skip this
pass
That's a rather long name... I don't think it needs a leading PyUnicode_AsFSString()? |
Here is an updated patch which applies cleanly and fixes some additional The unit tests profile, cProfile and doctest fail w/ and w/o this patch. |
Hm? This is a one-word patch to email/generator.py. On 10/15/07, Christian Heimes <report@bugs.python.org> wrote:
|
Yes, I already noticed it and I'm creating a new patch now. I saw your Here is the new patch |
Any details on those? They don't fail for me. |
I'll check this in as soon as there's agreement on the list about this. Not that I expect disagreement, but I just realized it was never brought |
Here you are. $ ./python Lib/test/test_cProfile.py
Ordered by: standard name ncalls tottime percall cumtime percall filename:lineno(function) Ordered by: standard name Function called... Ordered by: standard name Function was called by... #################################### doctest (doctest) ... 66 tests with zero failures
**********************************************************************
File "/home/heimes/dev/python/py3k/Lib/test/test_doctest.py", line 1570,
in test.test_doctest.test_debug
Failed example:
try: doctest.debug_src(s)
finally: sys.stdin = real_stdin
Expected:
> <string>(1)<module>()
(Pdb) next
12
--Return--
> <string>(1)<module>()->None
(Pdb) print(x)
12
(Pdb) continue
Got:
> /home/heimes/dev/python/py3k/Lib/encodings/utf_8.py(16)decode()
-> return codecs.utf_8_decode(input, errors, True)
(Pdb) next
--Return--
>
/home/heimes/dev/python/py3k/Lib/encodings/utf_8.py(16)decode()->('<string>',
8)
-> return codecs.utf_8_decode(input, errors, True)
(Pdb) print(x)
*** NameError: NameError("name 'x' is not defined",)
(Pdb) continue
12
**********************************************************************
1 items had failures:
1 of 4 in test.test_doctest.test_debug
***Test Failed*** 1 failures.
Traceback (most recent call last):
File "Lib/test/test_doctest.py", line 2422, in <module>
test_main()
File "Lib/test/test_doctest.py", line 2406, in test_main
test_support.run_doctest(test_doctest, verbosity=True)
File "/home/heimes/dev/python/py3k/Lib/test/test_support.py", line
569, in run_doctest
raise TestFailed("%d of %d doctests failed" % (f, t))
test.test_support.TestFailed: 1 of 414 doctests failed #################################### Traceback (most recent call last):
File "Lib/test/test_email.py", line 13, in <module>
test_main()
File "Lib/test/test_email.py", line 10, in test_main
test_support.run_unittest(suite())
File "/home/heimes/dev/python/py3k/Lib/test/test_support.py", line
541, in run_unittest
_run_suite(suite)
File "/home/heimes/dev/python/py3k/Lib/test/test_support.py", line
524, in _run_suite
raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
File "/home/heimes/dev/python/py3k/Lib/email/test/test_email.py", line
1445, in test_same_boundary_inner_outer
msg = self._msgobj('msg_15.txt')
File "/home/heimes/dev/python/py3k/Lib/email/test/test_email.py", line
67, in _msgobj
return email.message_from_file(fp)
File "/home/heimes/dev/python/py3k/Lib/email/__init__.py", line 46, in
message_from_file
return Parser(*args, **kws).parse(fp)
File "/home/heimes/dev/python/py3k/Lib/email/parser.py", line 68, in parse
data = fp.read(8192)
File "/home/heimes/dev/python/py3k/Lib/io.py", line 1240, in read
readahead, pending = self._read_chunk()
File "/home/heimes/dev/python/py3k/Lib/io.py", line 1136, in _read_chunk
pending = self._decoder.decode(readahead, not readahead)
File "/home/heimes/dev/python/py3k/Lib/codecs.py", line 291, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xbe in position 86:
unexpected code byte |
BTW we need a 2to3 fixer for this. Should be trivial -- just replace |
Even before this patch, the re module doesn't work very well on byte |
Guido van Rossum wrote:
I believe you that it's trivial for *you* but I've never dealt with the Let's see if the mail interface can handle attachments. |
Committed revision 58495. Thanks Christian!!! |
2007/10/15, Christian Heimes <report@bugs.python.org>:
It did. :-) I renamed it to fix_basestring and submitted it. See: Committed revision 58644. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: