Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #79861
| References | <b03c4e73-daac-4020-97f8-1506a4f3d8fd@googlegroups.com> |
|---|---|
| Date | 2014-10-28 15:30 -0700 |
| Subject | Re: checking whether a string is text or binary |
| From | Dan Stromberg <drsalists@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.15273.1414535418.18130.python-list@python.org> (permalink) |
On Tue, Oct 28, 2014 at 3:21 PM, Rick Dooling <rpdooling@gmail.com> 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
Back to comp.lang.python | Previous | Next — Previous in thread | Next 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