Re: pathlib PurePosixPath

2017-10-10 Thread eryk sun
On Tue, Oct 10, 2017 at 11:18 AM, Tim Golden wrote: > On 2017-10-10 10:58, Chris Angelico wrote: >> On Tue, Oct 10, 2017 at 8:56 PM, Tim Golden wrote: >> >>> In fact its presence in that filename creates a (usually hidden) data >>> stream piggybacked onto that file which has the name "abc" into w

Re: pathlib PurePosixPath

2017-10-10 Thread Tim Golden
On 2017-10-10 10:58, Chris Angelico wrote: On Tue, Oct 10, 2017 at 8:56 PM, Tim Golden wrote: My understanding of the document you linked to is that the colon still has special meaning, and thus you can't use it in arbitrary file names. In fact its presence in that filename creates a (usua

Re: pathlib PurePosixPath

2017-10-10 Thread Chris Angelico
On Tue, Oct 10, 2017 at 8:56 PM, Tim Golden wrote: >> My understanding of the document you linked to >> is that the colon still has special meaning, and thus you can't use it >> in arbitrary file names. > > > In fact its presence in that filename creates a (usually hidden) data stream > piggybacke

Re: pathlib PurePosixPath

2017-10-10 Thread Tim Golden
On 2017-10-10 10:28, Chris Angelico wrote: On Tue, Oct 10, 2017 at 8:22 PM, Tim Golden wrote: On 2017-10-10 08:29, Chris Angelico wrote: On Tue, Oct 10, 2017 at 6:21 PM, Sayth Renshaw wrote: Hi How do I create a valid file name and directory with pathlib? When I create it using PurePos

Re: pathlib PurePosixPath

2017-10-10 Thread Chris Angelico
On Tue, Oct 10, 2017 at 8:22 PM, Tim Golden wrote: > On 2017-10-10 08:29, Chris Angelico wrote: >> >> On Tue, Oct 10, 2017 at 6:21 PM, Sayth Renshaw >> wrote: >>> >>> Hi >>> >>> How do I create a valid file name and directory with pathlib? >>> >>> When I create it using PurePosixPath I end up wit

Re: pathlib PurePosixPath

2017-10-10 Thread Tim Golden
On 2017-10-10 08:29, Chris Angelico wrote: On Tue, Oct 10, 2017 at 6:21 PM, Sayth Renshaw wrote: Hi How do I create a valid file name and directory with pathlib? When I create it using PurePosixPath I end up with an OSError due to an obvously invlaid path being created. You're on Windows.

Re: pathlib PurePosixPath

2017-10-10 Thread Thomas Jollans
On 2017-10-10 09:44, Sayth Renshaw wrote: > >>> Hi >>> >>> How do I create a valid file name and directory with pathlib? >>> >>> When I create it using PurePosixPath I end up with an OSError due to an >>> obvously invlaid path being created. >> >> You're on Windows. The rules for POSIX paths don'

Re: pathlib PurePosixPath

2017-10-10 Thread Peter Otten
Sayth Renshaw wrote: > Thanks. Updated the script. But shouldn't it create the file if it doesn't > exist? Which none of them will. > pathlib.PurePath(r'C:\Users\Sayth\Projects\results', file_name) > with open(result_path, 'a') as f: > f.write(data) > ##Output > File

Re: pathlib PurePosixPath

2017-10-10 Thread BlindAnagram
On 10/10/2017 08:44, Sayth Renshaw wrote: > >>> Hi >>> >>> How do I create a valid file name and directory with pathlib? >>> >>> When I create it using PurePosixPath I end up with an OSError due to an >>> obvously invlaid path being created. >> >> You're on Windows. The rules for POSIX paths don'

Re: pathlib PurePosixPath

2017-10-10 Thread Sayth Renshaw
> > Hi > > > > How do I create a valid file name and directory with pathlib? > > > > When I create it using PurePosixPath I end up with an OSError due to an > > obvously invlaid path being created. > > You're on Windows. The rules for POSIX paths don't apply to your file > system, and... > > >

Re: pathlib PurePosixPath

2017-10-10 Thread Chris Angelico
On Tue, Oct 10, 2017 at 6:21 PM, Sayth Renshaw wrote: > Hi > > How do I create a valid file name and directory with pathlib? > > When I create it using PurePosixPath I end up with an OSError due to an > obvously invlaid path being created. You're on Windows. The rules for POSIX paths don't apply

pathlib PurePosixPath

2017-10-10 Thread Sayth Renshaw
Hi How do I create a valid file name and directory with pathlib? When I create it using PurePosixPath I end up with an OSError due to an obvously invlaid path being created. import pathlib for dates in fullUrl: # print(dates) time.sleep(0.3) r = requests.get(dates) data = r.jso