Re: Changing filenames from Greeklish => Greek (subprocess complain)

2017-09-06 Thread geojitmailus
On Saturday, June 1, 2013 at 9:14:36 PM UTC+5:30, Νικόλαος Κούρας wrote: > /home/nikos/public_html/cgi-bin/metrites.py in () > 217 template = htmldata + counter > 218 elif page.endswith('.py'): > => 219 htmldata = subprocess.check_output( > '/home/n

RE: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-12 Thread Carlos Nepomuceno
' Server: ApacheBooster/1.6' isn't a signature of httpd. I think you are really running something different. > From: nob...@nowhere.com > Subject: Re: Changing filenames from Greeklish => Greek (subprocess complain) > Date: Tue, 4 Jun 2013 14:01:48 +0100 > To: pyth

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-12 Thread Gene Heskett
On Sunday 02 June 2013 13:10:30 Chris Angelico did opine: > On Mon, Jun 3, 2013 at 2:21 AM, حéêüëلïٍ تï‎ٌلٍ wrote: > > Paying for someone to just remove a dash to get the script working is > > too much to ask for > > One dash: 1c > Knowing where to remove it: $99.99 > Total bill: $100.00 > > K

RE: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-12 Thread Carlos Nepomuceno
> To: python-list@python.org > From: breamore...@yahoo.co.uk > Subject: Re: Changing filenames from Greeklish => Greek (subprocess complain) > Date: Sun, 2 Jun 2013 15:51:31 +0100 [...] > "Steve is going for the pink ball - and f

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-11 Thread Larry Hudson
On 06/10/2013 01:11 AM, Νικόλαος Κούρας wrote: Τη Δευτέρα, 10 Ιουνίου 2013 10:51:34 π.μ. UTC+3, ο χρήστης Larry Hudson έγραψε: I mean utf-8 could use 1 byte for storing the 1st 256 characters. I meant up to 256, not above 256. 0 - 127, yes. 128 - 255 -> one byte of a multibyte code. you m

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-10 Thread Ned Batchelder
On Monday, June 10, 2013 3:48:08 PM UTC-4, jmfauth wrote: > - > > > > A coding scheme works with three sets. A *unique* set > of CHARACTERS, a *unique* set of CODE POINTS and a *unique* > set of ENCODED CODE POINTS, unicode or not. > > The relation between the set of characters and the set

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-10 Thread jmfauth
- A coding scheme works with three sets. A *unique* set of CHARACTERS, a *unique* set of CODE POINTS and a *unique* set of ENCODED CODE POINTS, unicode or not. The relation between the set of characters and the set of the code points is a *human* table, created with a sheet of paper and a pe

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-10 Thread Νικόλαος Κούρας
Τη Δευτέρα, 10 Ιουνίου 2013 2:59:03 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: > On Mon, 10 Jun 2013 00:10:38 -0700, nagia.retsina wrote: > > > > > Τη Κυριακή, 9 Ιουνίου 2013 3:31:44 μ.μ. UTC+3, ο χρήστης Steven D'Aprano > > > έγραψε: > > > > > >> py> c = 'α' > > >> py> ord(c) > > >> 9

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-10 Thread Steven D'Aprano
On Mon, 10 Jun 2013 00:10:38 -0700, nagia.retsina wrote: > Τη Κυριακή, 9 Ιουνίου 2013 3:31:44 μ.μ. UTC+3, ο χρήστης Steven D'Aprano > έγραψε: > >> py> c = 'α' >> py> ord(c) >> 945 > > The number 945 is the characters 'α' ordinal value in the unicode > charset correct? Correct. > The command i

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-10 Thread Andreas Perstinger
On 10.06.2013 11:59, Νικόλαος Κούρας wrote: s = 'α' s.encode('utf-8') > b'\xce\xb1' 'b' stands for binary right? No, here it stands for bytes: http://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals b'\xce\xb1' = we are looking at a byte in a hexadecim

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-10 Thread Νικόλαος Κούρας
> s = 'α' > s.encode('utf-8') > > b'\xce\xb1' 'b' stands for binary right? b'\xce\xb1' = we are looking at a byte in a hexadecimal format? if yes how could we see it in binary and decimal represenation? > > I see that the encoding of this char takes 2 bytes. But why two exactly

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-10 Thread Νικόλαος Κούρας
Τη Δευτέρα, 10 Ιουνίου 2013 11:15:38 π.μ. UTC+3, ο χρήστης Andreas Perstinger έγραψε: What is the difference between len('nikos') and len(b'nikos') First beeing the length of string nikos in characters while the second being the length of an ??? > The python interpreter will represent all valu

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-10 Thread Andreas Perstinger
On 10.06.2013 09:10, nagia.rets...@gmail.com wrote: Τη Κυριακή, 9 Ιουνίου 2013 3:31:44 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: py> c = 'α' py> ord(c) 945 The number 945 is the characters 'α' ordinal value in the unicode charset correct? Yes, the unicode character set is just a big li

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-10 Thread Νικόλαος Κούρας
Τη Δευτέρα, 10 Ιουνίου 2013 10:51:34 π.μ. UTC+3, ο χρήστης Larry Hudson έγραψε: > > I mean utf-8 could use 1 byte for storing the 1st 256 characters. I meant > > up to 256, not above 256. > 0 - 127, yes. > 128 - 255 -> one byte of a multibyte code. you mean that in utf-8 for 1 character to be s

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-10 Thread Larry Hudson
On 06/09/2013 03:37 AM, Νικόλαος Κούρας wrote: I mean utf-8 could use 1 byte for storing the 1st 256 characters. I meant up to 256, not above 256. NO!! 0 - 127, yes. 128 - 255 -> one byte of a multibyte code. That's why the decode fails, it sees it as incomplete data so it can't do anythi

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-10 Thread nagia . retsina
Τη Κυριακή, 9 Ιουνίου 2013 3:31:44 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: > py> c = 'α' > py> ord(c) > 945 The number 945 is the characters 'α' ordinal value in the unicode charset correct? The command in the python interactive session to show me how many bytes this character will take u

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Benjamin Kaplan
On Sun, Jun 9, 2013 at 2:20 AM, Νικόλαος Κούρας wrote: > Τη Κυριακή, 9 Ιουνίου 2013 12:12:36 μ.μ. UTC+3, ο χρήστης Cameron Simpson > έγραψε: >> On 09Jun2013 02:00, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= >> wrote: >> >> | Steven wrote: >> >> | >> Since 1 byte can hold up to 256 chars, why not

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Benjamin Kaplan
On Sun, Jun 9, 2013 at 2:38 AM, Νικόλαος Κούρας wrote: > Τη Κυριακή, 9 Ιουνίου 2013 12:20:58 μ.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: > >> > How about a string i wonder? >> > s = "νίκος" >> > what_are these_bytes = s.encode('iso-8869-7').encode(utf-8') > >> Ignoring the usual syntax error, this i

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread nagia . retsina
Τη Κυριακή, 9 Ιουνίου 2013 3:36:51 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: > > printing a greek Unicode string in the error with ASCII > > as the output encoding (default when not a tty IIRC). > An interesting thought. How would we test that? Please elaborare this for me. I ditn undertood

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Steven D'Aprano
On Sun, 09 Jun 2013 02:38:13 -0700, Νικόλαος Κούρας wrote: > s = 'α' > s = s.encode('iso-8859-7').decode('utf-8') > > UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 0: > unexpected end of data > > Why this error? because 'a' ordinal value > 127 ? Look at it this way... co

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Steven D'Aprano
On Sun, 09 Jun 2013 19:16:06 +1000, Cameron Simpson wrote: > If he's lucky the UnicodeEncodeError occurred while trying to print an > error message, That's not what happens at the interactive console: py> assert os.path.exists('Ж1') Traceback (most recent call last): File "", line 1, in Ass

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Steven D'Aprano
On Sun, 09 Jun 2013 02:00:46 -0700, Νικόλαος Κούρας wrote: > Steven wrote: >>> Since 1 byte can hold up to 256 chars, why not utf-8 use 1-byte for >>> values up to 256? > >>Because then how do you tell when you need one byte, and when you need >>two? If you read two bytes, and see 0x4C 0xFA, does

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Andreas Perstinger
On 09.06.2013 11:38, Νικόλαος Κούρας wrote: s = 'α' s = s.encode('iso-8859-7').decode('utf-8') print( s ) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 0: unexpected end of data Why this error? because 'a' ordinal value > 127 ? >>> s = 'α' >>> s.encode('iso-8859-7') b'

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Νικόλαος Κούρας
Please and tell me that this actually can be solved. Iam willing to try anything for 'files.py' to load propelry. Every thign works as expected in my webiste, have manages to correct pelatologio.poy and koukos.py. This is the last thing the webiste needs, that is files.py to load so users can gr

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Steven D'Aprano
On Sun, 09 Jun 2013 10:55:43 +0200, Lele Gaifax wrote: > Steven D'Aprano writes: > >> On Sat, 08 Jun 2013 22:09:57 -0700, nagia.retsina wrote: >> >>> chr('A') would give me the mapping of this char, the number 65 while >>> ord(65) would output the char 'A' likewise. >> >> Correct. Python uses Un

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Νικόλαος Κούρας
I k nwo i have been a pain in the ass these days but this is the lats explanation i want from you, just to understand it completely. >> Since 1 byte can hold up to 256 chars, why not utf-8 use 1-byte for >> values up to 256? >Because then how do you tell when you need one byte, and when you ne

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Νικόλαος Κούρας
Τη Κυριακή, 9 Ιουνίου 2013 12:14:12 μ.μ. UTC+3, ο χρήστης Νικόλαος Κούρας έγραψε: > Τη Κυριακή, 9 Ιουνίου 2013 11:15:07 π.μ. UTC+3, ο χρήστης Steven D'Aprano > έγραψε: > > > > > Please try this: log into the Linux server, and then start up a Python > > > > > import os, sys > > > print(sy

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Νικόλαος Κούρας
Τη Κυριακή, 9 Ιουνίου 2013 12:20:58 μ.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: > > How about a string i wonder? > > s = "νίκος" > > what_are these_bytes = s.encode('iso-8869-7').encode(utf-8') > Ignoring the usual syntax error, this is just a variant of the code I > posted: "s.encode('iso-8869-

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Νικόλαος Κούρας
Τη Κυριακή, 9 Ιουνίου 2013 12:12:36 μ.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε: > On 09Jun2013 02:00, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= > wrote: > > | Steven wrote: > > | >> Since 1 byte can hold up to 256 chars, why not utf-8 use 1-byte for > > | >> values up to 256? > > | > >

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Lele Gaifax
Νικόλαος Κούρας writes: > Τη Κυριακή, 9 Ιουνίου 2013 11:55:43 π.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: >> Uhm, no: "encode" transforms a Unicode string into an array of bytes, >> "decode" does the opposite transformation. You cannot do the former on >> an "arbitrary" array of bytes: >> >> >

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Cameron Simpson
On 09Jun2013 08:15, Steven D'Aprano wrote: | On Sun, 09 Jun 2013 00:00:53 -0700, nagia.retsina wrote: | > path = b'/home/nikos/public_html/data/apps/' | > files = os.listdir( path ) | > | > for filename in files: | > # Compute 'path/to/filename' | > filepath_bytes = path + filename | >

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Νικόλαος Κούρας
Τη Κυριακή, 9 Ιουνίου 2013 11:15:07 π.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: > Please try this: log into the Linux server, and then start up a Python > import os, sys > print(sys.version) > s = ('\N{GREEK SMALL LETTER ALPHA}\N{GREEK SMALL LETTER BETA}' > '\N{GREEK SMALL LETTER GAMMA

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Cameron Simpson
On 09Jun2013 02:00, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | Steven wrote: | >> Since 1 byte can hold up to 256 chars, why not utf-8 use 1-byte for | >> values up to 256? | | >Because then how do you tell when you need one byte, and when you need | >two? If you read two bytes, and se

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Νικόλαος Κούρας
Τη Κυριακή, 9 Ιουνίου 2013 11:55:43 π.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: > Steven D'Aprano writes: > > > > > On Sat, 08 Jun 2013 22:09:57 -0700, nagia.retsina wrote: > > > > > >> chr('A') would give me the mapping of this char, the number 65 while > > >> ord(65) would output the char 'A

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Νικόλαος Κούρας
Τη Κυριακή, 9 Ιουνίου 2013 11:02:48 π.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε: > In this scenario, really it is the Terminal program (eg Putty) which > cares about text (what you type, and what gets displayed). It is > because of mismatches between your Terminal local settings and the > encodi

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Νικόλαος Κούρας
Steven wrote: >> Since 1 byte can hold up to 256 chars, why not utf-8 use 1-byte for >> values up to 256? >Because then how do you tell when you need one byte, and when you need >two? If you read two bytes, and see 0x4C 0xFA, does that mean two >characters, with ordinal values 0x4C and 0xFA, o

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Lele Gaifax
Steven D'Aprano writes: > On Sat, 08 Jun 2013 22:09:57 -0700, nagia.retsina wrote: > >> chr('A') would give me the mapping of this char, the number 65 while >> ord(65) would output the char 'A' likewise. > > Correct. Python uses Unicode, where code-point 65 ("ordinal value 65") > means letter "A

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Steven D'Aprano
On Sun, 09 Jun 2013 00:00:53 -0700, nagia.retsina wrote: > path = b'/home/nikos/public_html/data/apps/' > files = os.listdir( path ) > > for filename in files: > # Compute 'path/to/filename' > filepath_bytes = path + filename > for encoding in ('utf-8', 'iso-8859-7', 'latin-1'):

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Νικόλαος Κούρας
I'm sorry posted by mistake unnessary code: here is the correct one that prodiuced the above error: # # Collect directory and its filenames as bytes path = b'/home/nikos/public_html/data/apps/' files = os.listdir( path ) for filename in fi

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Cameron Simpson
On 09Jun2013 06:25, Steven D'Aprano wrote: | [... heaps of useful explaination ...] | > When locale to linux system is set to utf-8 that would mean that the | > linux applications, should try to encode string into hdd by using | > system's default encoding to utf-8 nad read them back from bytes

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread nagia . retsina
Thanks Stevn, i ll read them in a bit. When i read them can you perhaps tell me whats wrong and ima still getting decode issues? [CODE] # = # If user downloaded a file, thank the user

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Steven D'Aprano
On Sat, 08 Jun 2013 22:09:57 -0700, nagia.retsina wrote: > chr('A') would give me the mapping of this char, the number 65 while > ord(65) would output the char 'A' likewise. Correct. Python uses Unicode, where code-point 65 ("ordinal value 65") means letter "A". There are older encodings. For e

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Steven D'Aprano
On Sun, 09 Jun 2013 07:46:40 +0300, Νικόλαος Κούρας wrote: > Why does every character in a character set needs to be associated with > a numeric value? Because computers are digital, not analog, and because bytes are numbers. Here are a few of the 256 possible bytes, written in binary, decimal a

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread nagia . retsina
Τη Σάββατο, 8 Ιουνίου 2013 9:47:53 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > Fortunately, Python lets us hide away pretty much all those details, > just as it lets us hide away the details of what makes up a list, a > dictionary, or an integer. You can safely assume that the string "foo" > i

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Νικόλαος Κούρας
On 9/6/2013 1:32 πμ, Cameron Simpson wrote: On 08Jun2013 14:14, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | Τη Σάββατο, 8 Ιουνίου 2013 10:01:57 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: | > ASCII actually needs 7 bits to store a character. Since computers are | > optimized to work wi

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Cameron Simpson
On 08Jun2013 14:14, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | Τη Σάββατο, 8 Ιουνίου 2013 10:01:57 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: | > ASCII actually needs 7 bits to store a character. Since computers are | > optimized to work with bytes, not bits, normally ASCII character

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Chris Angelico
On Sun, Jun 9, 2013 at 7:21 AM, Νικόλαος Κούρας wrote: > Sorry for displaying my code so many times, i know i ahve exhaust you but hti > is the last thinkg i am gonna ask from you in this thread. We are very close > to have this working. You need to spend more time reading and less time frantic

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Νικόλαος Κούρας
Sorry for displaying my code so many times, i know i ahve exhaust you but hti is the last thinkg i am gonna ask from you in this thread. We are very close to have this working. # # Collect directory and its filenames as bytes path = b'/hom

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Νικόλαος Κούρας
Τη Σάββατο, 8 Ιουνίου 2013 10:01:57 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: > ASCII actually needs 7 bits to store a character. Since computers are > optimized to work with bytes, not bits, normally ASCII characters are > stored in a single byte, with one bit wasted. So ASCII and Unicode

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Chris Angelico
On Sun, Jun 9, 2013 at 4:01 AM, Νικόλαος Κούρας wrote: > Hold on! > > In the beginning there was ASCII with 0-127 values and then there was > Unicode with 0-127 of ASCII's + i dont know how much many more? > > Now ASCIII needs 1 byte to store a single character while Unicode needs 2 > bytes to sto

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Steven D'Aprano
On Sat, 08 Jun 2013 21:01:23 +0300, Νικόλαος Κούρας wrote: > In the beginning there was ASCII with 0-127 values No, there were encoding systems that existed before ASCII, such as EBCDIC. But we can ignore those, and just start with ASCII. > and then there was > Unicode with 0-127 of ASCII's +

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Νικόλαος Κούρας
On 8/6/2013 5:49 πμ, Cameron Simpson wrote: On 07Jun2013 04:53, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | Τη Παρασκευή, 7 Ιουνίου 2013 11:53:04 π.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε: | > | >| errors='replace' mean dont break in case or error? | > | > | >Yes. The result will be c

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread MRAB
On 08/06/2013 17:53, Νικόλαος Κούρας wrote: Sorry for th delay guys, was busy with other thigns today and i am still reading your resposes, still ahvent rewad them all just Cameron's: Here is what i have now following Cameron's advices: #===

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Νικόλαος Κούρας
Okey after reading also Steven post, i was relived form the previous suck position i was, so with an alternation of a few variable names here is the code now: # # Collect directory and its filenames as bytes path = b'/home/nikos/public_htm

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Νικόλαος Κούρας
Sorry for th delay guys, was busy with other thigns today and i am still reading your resposes, still ahvent rewad them all just Cameron's: Here is what i have now following Cameron's advices: # # Collect filenames of the path directory as

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread MRAB
On 08/06/2013 07:49, Νικόλαος Κούρας wrote: Τη Σάββατο, 8 Ιουνίου 2013 5:52:22 π.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε: On 07Jun2013 11:52, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | ni...@superhost.gr [~/www/cgi-bin]# [Fri Jun 07 21:49:33 2013] [error] [client 79.103.41.173] F

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Roel Schroeven
Νικόλαος Κούρας schreef: Session settings afaik is for putty to remember hosts to connect to, not terminal options. I might be worng though. No matter how many times i change its options next time i run it always defaults back. Putty can most definitely remember its settings: - Start PuTTY; you

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Steven D'Aprano
On Thu, 06 Jun 2013 23:35:33 -0700, nagia.retsina wrote: >> Working with bytes is only for when the file names are turned to >> garbage. Your file names (some of them) are turned to garbage. Fix >> them, and then use file names as strings. > > Can't '~/data/apps/' is filled every day with more an

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Chris Angelico
On Sat, Jun 8, 2013 at 5:26 PM, Steven D'Aprano wrote: > On Fri, 07 Jun 2013 23:49:17 -0700, Νικόλαος Κούρας wrote: > > [...] >> Oh iam very sorry. >> Oh my God i cant beleive i missed a colon *again*: >> >> I have corrected this: > > [snip code] > > Stop posting your code after every trivial edit

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Steven D'Aprano
On Fri, 07 Jun 2013 23:49:17 -0700, Νικόλαος Κούρας wrote: [...] > Oh iam very sorry. > Oh my God i cant beleive i missed a colon *again*: > > I have corrected this: [snip code] Stop posting your code after every trivial edit!!! -- Steven -- http://mail.python.org/mailman/listinfo/python-li

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread Chris Angelico
On Sat, Jun 8, 2013 at 4:49 PM, Νικόλαος Κούρας wrote: > Oh my God i cant beleive i missed a colon *again*: For most Python programmers, this is a matter of moments to solve. Run the program, get a SyntaxError, fix it. Non-interesting event. (Maybe even sooner than that, if the editor highlights

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Νικόλαος Κούρας
Τη Σάββατο, 8 Ιουνίου 2013 5:52:22 π.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε: > On 07Jun2013 11:52, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= > wrote: > > | ni...@superhost.gr [~/www/cgi-bin]# [Fri Jun 07 21:49:33 2013] [error] > [client 79.103.41.173] File "/home/nikos/public_html/cgi-bin/

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Cameron Simpson
On 07Jun2013 04:53, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | Τη Παρασκευή, 7 Ιουνίου 2013 11:53:04 π.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε: | > | >| errors='replace' mean dont break in case or error? | > | > | >Yes. The result will be correct for correct iso-8859-7 and slightly m

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Cameron Simpson
On 07Jun2013 11:52, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | ni...@superhost.gr [~/www/cgi-bin]# [Fri Jun 07 21:49:33 2013] [error] [client 79.103.41.173] File "/home/nikos/public_html/cgi-bin/files.py", line 81 | [Fri Jun 07 21:49:33 2013] [error] [client 79.103.41.173] if( flag

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Zero Piraeus
: On 7 June 2013 16:45, MRAB wrote: > On 07/06/2013 20:31, Zero Piraeus wrote: >> [something exasperated, in capitals] > > Have you noticed how the line in the traceback doesn't match the line > in the post? Actually, I hadn't. It's not exactly a surprise at this point, though ... I learnt a ne

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread MRAB
On 07/06/2013 20:31, Zero Piraeus wrote: : On 7 June 2013 14:52, Νικόλαος Κούρας wrote: File "/home/nikos/public_html/cgi-bin/files.py", line 81 [Fri Jun 07 21:49:33 2013] [error] [client 79.103.41.173] if( flag == 'greek' ) [Fri Jun 07 21:49:33 2013] [error] [client 79.103.41.173]

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Zero Piraeus
: On 7 June 2013 14:52, Νικόλαος Κούρας wrote: File "/home/nikos/public_html/cgi-bin/files.py", line 81 > [Fri Jun 07 21:49:33 2013] [error] [client 79.103.41.173] if( flag == > 'greek' ) > [Fri Jun 07 21:49:33 2013] [error] [client 79.103.41.173] > ^ > [Fri Jun 07 2

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Νικόλαος Κούρας
Τη Παρασκευή, 7 Ιουνίου 2013 5:29:25 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: > This is a worse way of doing it because the ISO-8859-7 encoding has 1 > byte per codepoint, meaning that it's more 'tolerant' (if that's the > word) of errors. A sequence of bytes that is actually UTF-8 can be > decoded as

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Steven D'Aprano
On Fri, 07 Jun 2013 04:53:42 -0700, Νικόλαος Κούρας wrote: > Do you mean that utf-8, latin-iso, greek-iso and ASCII have the 1st > 0-127 codepoints similar? You can answer this yourself. Open a terminal window and start a Python interactive session. Then try it and see what happens: s = ''.joi

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread MRAB
On 07/06/2013 12:53, Νικόλαος Κούρας wrote: [snip] # # Collect filenames of the path dir as bytes greek_filenames = os.listdir( b'/home/nikos/public_html/data/apps/' ) for filename in greek_filenames: # Compute 'path/to/filename' i

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Νικόλαος Κούρας
Τη Παρασκευή, 7 Ιουνίου 2013 11:53:04 π.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε: > On 07Jun2013 09:56, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= > wrote: > > | On 7/6/2013 4:01 πμ, Cameron Simpson wrote: > > | >On 06Jun2013 11:46, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= > wrote: > > | >|

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread alex23
On Jun 7, 6:53 pm, Cameron Simpson wrote: >   Experiment: > >     LC_ALL=C ls -b >     LC_ALL=utf-8 ls -b >     LC_ALL=iso-8859-7 ls -b > >   And the Terminal itself is decoding the output for display, and >   encoding your input keystrokes to feed as input to the command >   line. This reminded

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Cameron Simpson
On 07Jun2013 09:56, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | On 7/6/2013 4:01 πμ, Cameron Simpson wrote: | >On 06Jun2013 11:46, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | >| Τη Πέμπτη, 6 Ιουνίου 2013 3:44:52 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: | >| > py> s = '999-Eυχή

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Cameron Simpson
On 07Jun2013 11:10, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | On 7/6/2013 10:42 πμ, Michael Weylandt wrote: | >os.rename( filepath_bytes filepath.encode('utf-8') | >Missing comma, which is, after all, just a matter of syntax so it can't matter, right? | | I doubted that os.rename argumen

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread R. Michael Weylandt
On Fri, Jun 7, 2013 at 9:10 AM, Νικόλαος Κούρας wrote: > On 7/6/2013 10:42 πμ, Michael Weylandt wrote: > >>> os.rename( filepath_bytes filepath.encode('utf-8') > >> Missing comma, which is, after all, just a matter of syntax so it can't >> matter, right? > > I doubted that os.rename arguments must

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Νικόλαος Κούρας
On 7/6/2013 10:42 πμ, Michael Weylandt wrote: os.rename( filepath_bytes filepath.encode('utf-8') Missing comma, which is, after all, just a matter of syntax so it can't matter, right? I doubted that os.rename arguments must be comma seperated. But ater reading the docs. s.rename(/src/,/dst/)

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Michael Weylandt
On Jun 7, 2013, at 8:32, Νικόλαος Κούρας wrote: > Τη Παρασκευή, 7 Ιουνίου 2013 10:09:29 π.μ. UTC+3, ο χρήστης Lele Gaifax > έγραψε: > >> As already explained, often a SyntaxError is introduced by *preceeding* >> "text", so you must look at your code with a "wider eye". > > That what i ahte a

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Νικόλαος Κούρας
Τη Παρασκευή, 7 Ιουνίου 2013 10:09:29 π.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: > As already explained, often a SyntaxError is introduced by *preceeding* > "text", so you must look at your code with a "wider eye". That what i ahte aabout error reporting. You have some syntax error someplace and

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Chris Angelico
On Fri, Jun 7, 2013 at 5:08 PM, Νικόλαος Κούρας wrote: > I'll google Traal right now. The one thing you're actually willing to go research, and it's actually something that won't help you. Traal is the name of my personal laptop. Spend your Googletrons on something else. :) ChrisA -- http://mai

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Νικόλαος Κούρας
Τη Παρασκευή, 7 Ιουνίου 2013 9:46:53 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Fri, Jun 7, 2013 at 4:35 PM, wrote: > > > Yes, but but 'putty' seems to always forget when i tell it to use utf8 for > > displaying and always picks up the Win8's default charset and it doesnt > > have a sa

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Lele Gaifax
nagia.rets...@gmail.com writes: > File "files.py", line 75 > os.rename( filepath_bytes filepath.encode('utf-8') ) > ^ > SyntaxError: invalid syntax > > I am seeign the caret pointing at filepath but i cant follow what it > tries to tell me. As already ex

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Νικόλαος Κούρας
On 7/6/2013 4:01 πμ, Cameron Simpson wrote: On 06Jun2013 11:46, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | Τη Πέμπτη, 6 Ιουνίου 2013 3:44:52 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: | > py> s = '999-Eυχή-του-Ιησού' | > py> bytes_as_utf8 = s.encode('utf-8') | > py> t = bytes_as_utf8

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Chris Angelico
On Fri, Jun 7, 2013 at 4:35 PM, wrote: > Yes, but but 'putty' seems to always forget when i tell it to use utf8 for > displaying and always picks up the Win8's default charset and it doesnt have > a save options dialog. I cant always remember to switch to utf8 charset or > renaming all the tim

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread nagia . retsina
Τη Παρασκευή, 7 Ιουνίου 2013 4:25:40 π.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: > MRAB tells you to work with the bytes, because the filenames' bytes are > invalid decoded as UTF-8. If you fix the file names by renaming using a > terminal set to UTF-8, then they will be valid and you can for

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread rusi
On Jun 7, 12:03 am, Lele Gaifax wrote: > You should *read* and *understand* the error message! When you *shout* at the deaf, the non-deaf get deaf . -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Steven D'Aprano
On Thu, 06 Jun 2013 11:46:20 -0700, Νικόλαος Κούρας wrote: > Τη Πέμπτη, 6 Ιουνίου 2013 3:44:52 μ.μ. UTC+3, ο χρήστης Steven D'Aprano > έγραψε: > >> py> s = '999-Eυχή-του-Ιησού' >> py> bytes_as_utf8 = s.encode('utf-8') >> py> t = bytes_as_utf8.decode('iso-8859-7', errors='replace') >> py> print

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Steven D'Aprano
On Thu, 06 Jun 2013 13:56:36 -0700, Νικόλαος Κούρας wrote: > SyntaxError: invalid syntax > > > Dont know how to add a bytestremed path to a bytestream filename Nikos, READ THE ERROR MESSAGE!!! The error doesn't say anything about *adding*. It is a SyntaxError. Please stop flooding us with do

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Steven D'Aprano
On Thu, 06 Jun 2013 12:17:16 -0700, Νικόλαος Κούρας wrote: > i can remove the bianry openign from os.listdir but then this will not > work. MRAB has told me that i need to open those paths and filenames as > bytestreams and not as unicode strings. Do you understand why? If you do not understand

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Cameron Simpson
On 06Jun2013 11:46, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | Τη Πέμπτη, 6 Ιουνίου 2013 3:44:52 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: | > py> s = '999-Eυχή-του-Ιησού' | > py> bytes_as_utf8 = s.encode('utf-8') | > py> t = bytes_as_utf8.decode('iso-8859-7', errors='replace') | > py

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Cameron Simpson
On 06Jun2013 05:04, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | We are in test mode so i dont know if when renaming actually take place what the encodings will be. | Shall i switch off test mode and try it for real? I would make a copy. Since you're renaming stuff, hard links would do:

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread MRAB
On 06/06/2013 22:07, Lele Gaifax wrote: Νικόλαος Κούρας writes: Tahnks here is what i have up until now with many corrections. I'm afraid many more are needed :-) ... # rename filename form greek bytestreams --> utf-8 bytestreams old_path = b'/home/nikos/pub

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Lele Gaifax
Νικόλαος Κούρας writes: > The only problem now is the bytestrings: *One*, not the *only*. > > ni...@superhost.gr [~/www/cgi-bin]# [Thu Jun 06 23:50:42 2013] [error] > [client 79.103.41.173] File "files.py", line 78 > [Thu Jun 06 23:50:42 2013] [error] [client 79.103.41.173] old_path = >

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Lele Gaifax
Νικόλαος Κούρας writes: > Tahnks here is what i have up until now with many corrections. I'm afraid many more are needed :-) > ... > # rename filename form greek bytestreams --> utf-8 bytestreams > old_path = b'/home/nikos/public_html/data/apps/' + b'filename') >

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Νικόλαος Κούρας
I'm very sorry for continuous pastes. Didnt include the whole thing before. Here it is: # # Get filenames of the path dir as bytestrings path = os.listdir( b'/home/nikos/public_html/data/apps/' ) # iterate over all filenames in the apps dir

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Νικόλαος Κούρας
Has some errors: # # Get filenames of the apps directory as bytestrings path = os.listdir( b'/home/nikos/public_html/data/apps/' ) # iterate over all filenames in the apps directory for filename in path: # Grabbing just the filename

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 11:25:15 μ.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: > Νικόλαος Κούρας writes: > > > > > Now the error afetr fixithg that transformed to: > > > > > > [Thu Jun 06 22:13:49 2013] [error] [client 79.103.41.173] filename = > > fullpath.replace( '/home/nikos/public_htm

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Lele Gaifax
Νικόλαος Κούρας writes: > Now the error afetr fixithg that transformed to: > > [Thu Jun 06 22:13:49 2013] [error] [client 79.103.41.173] filename = > fullpath.replace( '/home/nikos/public_html/data/apps/', '' ) > [Thu Jun 06 22:13:49 2013] [error] [client 79.103.41.173] TypeError: expected

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Νικόλαος Κούρας
Actually about the Spurious procedure iam happy with myelf that came up with this: # Delete spurious cur.execute('''SELECT url FROM files''') data = cur.fetchall() for filename in path url = '/home/nikos/public_html/data/apps/' + filename urls.add( url ) for url in data:

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 10:42:25 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: > On 06/06/2013 19:13, οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ > wrote: > > > > οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½, 6 οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ 2013 3:50:52 > οΏ½.οΏ½. UTC+3, οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ MRAB οΏ½οΏ½οΏ

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread MRAB
On 06/06/2013 19:13, Νικόλαος Κούρας wrote: Τη Πέμπτη, 6 Ιουνίου 2013 3:50:52 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: > If you're happy for that change to happen, then go ahead. I have made some modifications to the code you provided me but i think something that doesn

  1   2   3   >