Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'edsu/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jimnicholls committed Sep 7, 2015
2 parents 4f4f62d + 6d4b1a6 commit 6bd235e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pymarc/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

isbn_regex = re.compile(r'([0-9\-xX]+)')

@six.python_2_unicode_compatible
class Record(Iterator):
"""
A class for representing a MARC record. Each Record object is made up of
Expand Down Expand Up @@ -82,7 +83,7 @@ def __str__(self):
"""
# join is significantly faster than concatenation
text_list = ['=LDR %s' % self.leader]
text_list.extend([str(field) for field in self.fields])
text_list.extend([six.text_type(field) for field in self.fields])
text = '\n'.join(text_list) + '\n'
return text

Expand Down
1 change: 1 addition & 0 deletions test/diacritic.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
02710cam a22003018a 45000010009000000050017000090080041000269060045000679250104001129550080002160100017002960200029003130200026003420400013003680500023003810820017004042450099004212600052005202630009005723000011005815040041005925051531006336500039021646500028022036500035022317000024022669630118022901709126920131029120147.0111220s2012 enk b 000 0 eng  a7bcbccorignewd1eecipf20gy-gencatlg0 aacquireb2 shelf copiesxpolicy defaulteclaim1 2012-10-24eclaim2 2013-06-13eto CAD 2013-10-29 bxg08 2011-12-20ixg08 2011-12-20axg09 2011-12-21 to Deweywrd05 2011-12-23 a 2011052495 a9780415782654 (hardback) a9780203112021 (ebook) aDLCcDLC00aK564.C6bA835 201200a302.23/122300aAmateur media :bsocial, cultural and legal perspectives /cedited by Dan Hunter ... [et al.]. aAbingdon, Oxon ;aN.Y., NY :bRoutledge,c2012. a1206 ap. cm. aIncludes bibliographical references.0 aHistories of user-generated content: between formal and informal media economies / Ramon Lobato, Julian Thomas and Dan Hunter -- Competing myths of informal economies / Megan Richardson and Jake Goldenfein -- Start with the household / John Quiggin -- Amateur digital content and proportional commerce / Steven Hetcher -- YouTube and the formalisation of amateur media / Jean Burgess -- The relationship between user-generated content and commerce / Kimberlee Weatherall -- The manufacture of 'authentic' buzz and the legal relations of MasterChef / Kathy Bowrey -- Harry Potter and the transformation wand : fair use, canonicity and fan activity / David Tan -- The simulation of 'authentic' buzz : T-mobile and the flash mob dance / Marc Trabsky -- Prestige and professionalisation at the margins of the journalistic field : the case of music writers / Ramon Lobato and Lawson Fletcher -- Swedish subtitling strike called off! : fan-to-fan piracy, translation, and the primacy of authorisation / Eva Hemmungs Wirtén -- Have amateur media enhanced the possibilities for good media work? / David Hesmondhalgh -- Minecraft as Web 2.0 : amateur creativity and digital games / Greg Lastowka -- Cosplay, creativity and immaterial labours of love / Melissa de Zwart -- Web Zero: the amateur and the indie game developer / Christian McCrea -- Anonymous speech on the internet / Brian Murchison -- The privacy interest in anonymous blogging / Lisa Austin -- 'Privacy' of social networking texts / Megan Richardson and Julian Thomas. 0aSocial mediaxLaw and legislation. 0aUser-generated content. 0aInternetxLaw and legislation.1 aHunter, Dan,d1966- aStephen Gutierrez; phone: +44-2070176003; email: stephen.gutierrez@informa.com; bc: stephen.gutierrez@informa.com
7 changes: 7 additions & 0 deletions test/utf8_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ def process_xml(record):
# remove it
os.remove('test/write-utf8-test.dat')

def test_combining_diacritic(self):
"""issue 74: raises UnicodeEncodeError on Python 2"""
reader = pymarc.MARCReader(open('test/diacritic.dat', 'rb'))
record = next(reader)
str(record)


def suite():
test_suite = unittest.makeSuite(MARCUnicodeTest, 'test')
return test_suite
Expand Down

0 comments on commit 6bd235e

Please sign in to comment.