Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #79862
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2014-10-28 16:03 -0700 |
| References | <b03c4e73-daac-4020-97f8-1506a4f3d8fd@googlegroups.com> <mailman.15273.1414535418.18130.python-list@python.org> |
| Message-ID | <3e6d0ee5-057b-47a7-ad4e-c97b39f10d17@googlegroups.com> (permalink) |
| Subject | Re: checking whether a string is text or binary |
| From | richarddooling@gmail.com |
On Tuesday, October 28, 2014 5:30:31 PM UTC-5, Dan Stromberg wrote:
> On Tue, Oct 28, 2014 at 3:21 PM, Rick Dooling wrote:
> > I tried to convert the code using 2to3 and it broke.
> >
> > The error I get when using Python 3 is on this line:
> >
> > _null_trans = string.maketrans("", "")
> >
> > and the error reads
> >
> > AttributeError: 'module' object has no attribute 'maketrans'
> >
> > Any help? I barely understand the whole unicode business, but any guidance in updating the code would be much appreciated.
>
> Top hit on "python3 maketrans" in Google:
>
> http://stackoverflow.com/questions/3031045/how-come-string-maketrans-does-not-work-in-python-3-1
THANK YOU
I read that twice before without being able to figure what I needed to change, but third time is a charm.
Rick
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
checking whether a string is text or binary Rick Dooling <rpdooling@gmail.com> - 2014-10-28 15:21 -0700
Re: checking whether a string is text or binary Dan Stromberg <drsalists@gmail.com> - 2014-10-28 15:30 -0700
Re: checking whether a string is text or binary richarddooling@gmail.com - 2014-10-28 16:03 -0700
csiph-web