Éric Araujo added the comment:
I don’t understand one thing: you said the output wasn’t changed, then show an
example of changed output: “--xxx-- vs
--b'xxx'--”.
The “data” that is displayed is supposed to be text; showing “b'” and “'” is a
regression for the
Arfrever Frehtes Taifersar Arahesis added the comment:
Output is different between Python 2 and 3, but not different between different
versions in Python 3.
Output in Python 3 is e.g. --b'xxx'-- both before and after
commit 791674a74e47.
I suggest to create a separate issue for
Éric Araujo added the comment:
Thanks for correcting me. I created #20900.
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20363
___
Éric Araujo added the comment:
Thanks for applying the patch. distutils tests don’t cover 100% of the
codebase; did you test manually that the behavior of the changed code was still
correct?
--
___
Python tracker rep...@bugs.python.org
Serhiy Storchaka added the comment:
At least it wasn't changed.
As I see, affected line is used to output debugging message (disabled by
default). It produces different result in 2.7 and 3.x
(--xxx-- vs --b'xxx'--) due to the
difference between 2.x str and 3.x
Serhiy Storchaka added the comment:
LGTM.
--
assignee: lukasz.langa - serhiy.storchaka
stage: patch review - commit review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20363
___
Roundup Robot added the comment:
New changeset 791674a74e47 by Serhiy Storchaka in branch '3.3':
Issue #20363. Fixed BytesWarning triggerred by test suite.
http://hg.python.org/cpython/rev/791674a74e47
New changeset a4431dce107a by Serhiy Storchaka in branch 'default':
Issue #20363. Fixed
Serhiy Storchaka added the comment:
Thank you Arfrever for your report. Thank you Berker for your patch.
--
resolution: - fixed
stage: commit review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Berker Peksag added the comment:
Thanks for the review, Arfrever and Serhiy. Here's a new patch.
--
Added file: http://bugs.python.org/file33712/issue20363_v2.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20363
Arfrever Frehtes Taifersar Arahesis added the comment:
The new patch has %s and %r reversed in Lib/distutils/command/register.py.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20363
___
Berker Peksag added the comment:
Ah, my bad. Thanks Arfrever.
--
Added file: http://bugs.python.org/file33715/issue20363_v3.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20363
___
Changes by Berker Peksag berker.pek...@gmail.com:
Removed file: http://bugs.python.org/file33669/issue20363.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20363
___
Changes by Berker Peksag berker.pek...@gmail.com:
Removed file: http://bugs.python.org/file33712/issue20363_v2.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20363
___
Serhiy Storchaka added the comment:
And
'print(hash(eval(%s.decode(utf-8' % repr_.encode(utf-8)
can be simplified to
'print(hash(eval(%a)))' % repr_
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20363
New submission from Arfrever Frehtes Taifersar Arahesis:
[194/388] test_base64
/tmp/cpython/Lib/base64.py:365: BytesWarning: str() on a bytes instance
by {} and {}.format(_A85START, _A85END))
...
[204/388] test_hash
/tmp/cpython/Lib/test/test_hash.py:175: BytesWarning: str() on a bytes
Changes by Łukasz Langa luk...@langa.pl:
--
assignee: - lukasz.langa
stage: - needs patch
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20363
___
Arfrever Frehtes Taifersar Arahesis added the comment:
I think that repr could be used:
str(bytes_instance)- repr(bytes_instance)
%s % bytes_instance - %r % bytes_instance
Any opinions?
--
___
Python tracker rep...@bugs.python.org
Łukasz Langa added the comment:
`repr(bytestr)[1:-1]` ;-)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20363
___
___
Python-bugs-list mailing
Arfrever Frehtes Taifersar Arahesis added the comment:
You rather meant [2:-1] instead of [1:-1], but if initial b' and final '
are not needed in result string, then maybe just call .decode() on an instance
of bytes.
str(bxxx)
b'xxx'
repr(bxxx)
b'xxx'
repr(bxxx)[1:-1]
'xxx
Serhiy Storchaka added the comment:
I think that repr could be used:
Agree.
{}.format(bytestr) - {!r}.format(bytestr)
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20363
Berker Peksag added the comment:
Here's a patch to silence BytesWarnings.
--
assignee: lukasz.langa -
keywords: +patch
nosy: +berker.peksag
stage: needs patch -
type: behavior -
Added file: http://bugs.python.org/file33669/issue20363.diff
___
Changes by Berker Peksag berker.pek...@gmail.com:
--
assignee: - lukasz.langa
stage: - patch review
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20363
___
Arfrever Frehtes Taifersar Arahesis added the comment:
I think that %s is better for 'dashes' variable (which is always str) in
Lib/distutils/command/register.py:
self.announce('%s%r%s' % (dashes, data, dashes))
--
___
Python tracker
23 matches
Mail list logo