Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #83153

pathlib type error

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <georg.grafendorfer@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.012
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'subject:error': 0.03; 'error:': 0.07; 'python3': 0.07; 'expected.': 0.09; 'operand': 0.09; 'python': 0.11; 'jan': 0.12; './python': 0.16; 'amd64': 0.16; 'subject:type': 0.16; 'typeerror:': 0.16; '>>>': 0.22; 'import': 0.22; '&gt;&gt;&gt;': 0.24; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'getting': 0.31; '"",': 0.31; 'file': 0.32; 'linux': 0.33; '(most': 0.33; 'received:google.com': 0.35; 'machine.': 0.36; 'thanks': 0.36; 'skip:& 10': 0.38; 'skip:. 20': 0.38; 'to:addr:python-list': 0.38; 'recent': 0.39; 'skip:& 20': 0.39; 'help,': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'more': 0.64; '2014,': 0.84; '4.4.1': 0.84; 'ships': 0.84; 'type(s)': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=0j0DdYqqVcKhII9eehhFKpbw40+B27x7IPrnjX+Yw/I=; b=HTUQzbBnCstBAzxFh/qMPF0jbi2idlCBMsyMsL6EHxvkxpmZNk3ooL5/fhLzh57b0l KXornU583VMRBrAYNG7pov9XZQ9w9XJfFdDNHPedrbX18pFrfqLJLquCEJdY0aV+aqMK vq4sLBCG4gT+JtYAJGrU3jGmr0bqI48lZzhNdg1unHKZSebxuEDeMCMMMzPxJ/pV8JyK jmJSFVufF74YLEQ0BrD+dkhJ3A8e3KPHnyFW1McTTTk9/z0qJmaYaSaY2iaV5HFRmJ3I bVudFW67W3RYMlv4mInlgbJ3ldvv7n+G0ayzYw1RZktctBZN+5v0yV9BPFxOgN16MPre vLeg==
MIME-Version 1.0
X-Received by 10.107.17.38 with SMTP id z38mr71148104ioi.29.1420286149671; Sat, 03 Jan 2015 03:55:49 -0800 (PST)
Date Sat, 3 Jan 2015 12:55:49 +0100
Subject pathlib type error
From Georg Grafendorfer <georg.grafendorfer@gmail.com>
To python-list@python.org
Content-Type multipart/alternative; boundary=001a113f66446e434d050bbe23cd
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.17346.1420286152.18130.python-list@python.org> (permalink)
Lines 68
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1420286152 news.xs4all.nl 2853 [2001:888:2000:d::a6]:49140
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:83153

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi

I'm using Debian 8 Jessie on an AMD64 machine.
Getting this error:

~$ python3
Python 3.4.2 (default, Oct  8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pathlib import Path
>>> p = Path("/etc")
>>> q = p / "init.d"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for /: 'PosixPath' and 'str'
>>>


This also happens if I compile python3.4.2 from scratch:

.../data/Python-3.4.2$ ./python
Python 3.4.2 (default, Jan  3 2015, 12:42:09)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pathlib import Path
>>> p = Path("/etc")
>>> q = p / "init.d"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for /: 'PosixPath' and 'str'
>>>


On the same computer, using rescuecd 4.4.1 (Nov 2014) which ships python
3.4.1 it works as expected.

thanks for help, Georg

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

pathlib type error Georg Grafendorfer <georg.grafendorfer@gmail.com> - 2015-01-03 12:55 +0100

csiph-web